This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: gcc's limits.h vs POSIX


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


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