This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ghost options generated from argp


* Rickard Jonsson:

> For a code sample, I've posted source code with the problem present in
> the following url:
> http://www.rickardjonsson.se/files/main.c
> NOTE: Will trigger download prompt in most cases.
>
> Compiling with -Wpedantic -Wall -Werror generates no additional output
> from using no flags at all.

(valgrind and -fsanitize=address are also useful if you are trying to
determine the cause of an apparent memory corruption.)

As explained here:

<https://www.gnu.org/software/libc/manual/html_node/Argp-Option-Vectors.html#Argp-Option-Vectors>

you need to add a sentinel { 0 } to the end of the options array.
Then the problem should go away.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]