Mail Archives: djgpp-workers/2003/04/26/04:33:18
Hello.
Charles Sandmann wrote:
>
> > And that is the point. -ansi -pedantic HAS to exclude it.
> > Otherwise the system is non-compliant.
>
> There is an entire section in stdlib.h which is already
> excluded - no need to put things in additional files.
To elaborate, there are some defines which control what is visible in a
module's namespace:
__STRICT_ANSI__
(__STDC_VERSION__ && __STDC_VERSION__ > 199901L) || !__STRICT_ANSI__
_POSIX_SOURCE
If you don't define anything, you get everything. If you define _POSIX_SOURCE,
you get all the C and POSIX things. If you define __STRICT_ANSI__, you get
just C89 stuff. If you define __STRICT_ANSI__ and __STDC_VERSION__
appropriately for C99, you get C99 stuff. Note that the compiler will define
__STRICT_ANSI__, __STDC_VERSION__ for you, depending on the switches. I think
_POSIX_SOURCE has to be defined using -D or #define before including the
appropriate file.
So all the "de facto" standard stuff would go in the section marked:
#ifndef _POSIX_SOURCE
...
#endif /* !_POSIX_SOURCE */
The C99 sections are in CVS or, now, alpha 1.
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -