This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc's limits.h vs POSIX
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 22 Jan 2004 01:26:52 +0000 (UTC)
- Subject: Re: gcc's limits.h vs POSIX
- References: <200401220116.i0M1G5Ps019902@greed.delorie.com>
On Wed, 21 Jan 2004, DJ Delorie wrote:
> POSIX defines a list of macros that are to be found in <limits.h> (for
> example, PATH_MAX).
>
> The <limits.h> that gcc generates does not include these.
>
> DJGPP's <limits.h>, for example, does.
>
> How does one get the system's <limits.h> ?
GCC's <limits.h> (the part that comes from limitx.h) includes
"syslimits.h" which does '#include_next <limits.h>', provided that the
system has its own <limits.h> detected at build time. The system
<limits.h> should then not define the standard C limits (for GCC), but
should define the others (conditional on the appropriate feature test
macros; if __STRICT_ANSI__ is defined without any feature test macros, the
POSIX limits should not be defined). It may also set MB_LEN_MAX (a C
standard macro for <limits.h>, that however is a library property) to a
value appropriate for the supported locales, in which case GCC's
<limits.h> will not override that value.
--
Joseph S. Myers
jsm@polyomino.org.uk