This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Ghost options generated from argp
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Rickard Jonsson <me at rickardjonsson dot se>
- Cc: libc-help at sourceware dot org
- Date: Thu, 29 Sep 2016 09:36:55 +0200
- Subject: Re: Ghost options generated from argp
- Authentication-results: sourceware.org; auth=none
- References: <20160929003859.GA22127@BadderB>
* 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.