This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: getopt with gcc -ansi
- From: Susukita Ryutaro <susukita at postman dot riken dot go dot jp>
- To: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- Cc: susukita at postman dot riken dot go dot jp, libc-alpha at sources dot redhat dot com
- Date: Thu, 12 Aug 2004 11:32:29 +0900
- Subject: 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