This is the mail archive of the libc-alpha@sources.redhat.com 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: getopt with gcc -ansi


> -ansi sets the baseline as C89 function only, feature test macros must be 
> defined for the rest.  The non-C89 headers may be simplified by declaring 
> some other functions anyway if all relevant standards say they must, but 
> -ansi plus non-C89 functions is only meant to be used with feature test 
> macros.  There is a brief note in CONFORMANCE about use of -ansi plus 
> feature test macros, though it is silent on the undefined case of using 
> POSIX headers without the necessary macros.
> 
> Using -ansi -D_POSIX_C_SOURCE=200112L will get you the getopt declaration.

I was able to turn on the declaration of getopt with
-D_POSIX_C_SOURCE=200112L. I searched for the keyword 'feature test
macros' and found Feature Test Macros Section in the manual.
Thanks.

susukita


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