[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#335171: glibc-doc: getsubopt() has different interface with #define _GNU_SOURCE



On Sat, Oct 22, 2005 at 11:11:27AM +0200, Werner Baumann wrote:
> When compiling with #define _GNU_SOURCE function getsubopt() seems to be
> defined as
> int getsubopt (char **optionp, char* const *tokens, char **valuep)
> and not as
> int getsubopt (char **optionp, const char* const *tokens, char **valuep)
> 
> Proof:
> Compile the example in section '25.3.13 Parsing of Suboptions Example'
> with #define _GNU_SOURCE and you get a warning about 'incompatible
> pointer typ in argument 2'.
> Chance definition
> const char *mount_opts[] =
> into
> char *mount_opts[] =
> and the warning will disapear.
> Should be mentioned in the documentation.

That's not what's going on.  Without -D_GNU_SOURCE you don't have a
prototype at all; GCC infers one.  Try using gcc -Wall to see what's
going on.

It'd be nice if the documentation said what #define you needed to use
this...

-- 
Daniel Jacobowitz
CodeSourcery, LLC



Reply to: