Ghost options generated from argp

Florian Weimer fw@deneb.enyo.de
Thu Sep 29 07:37:00 GMT 2016


* 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.



More information about the Libc-help mailing list