cpp found limits.h in FIXED_INCLUDE_DIR, but not in STANDARD_INCLUDE_DIR

Zhang Le r0bertz@gentoo.org
Tue Sep 16 10:25:00 GMT 2008

Hi all,

I have just tried gcc 4.4.0_alpha20080912.
But I encountered some problems related to <limits.h>.
like SSIZE_MAX/PATH_MAX undefined.
It turned out that the root cause seems to be gcc used the wrong limits.h, i.e.
(please see the details at the bottom of this email)

this file only contains some of the system's max value and it can't replace
/usr/include/limits.h. Presumably (is it?) cpp will stop searching for limits.h
when it finds the first one in cpp_include_defaults array. And FIXED_INCLUDE_DIR

So i am a little confused. How come this works in previous versions? 
BTW, the gcc i used was cross compiled on a x86 host.

Would you please explain a little bit about how fixed headers are supposed to
work? Is this a bug or a new feature but i missed something here?

The output of gcc -v
2f ~ # gcc -v
Using built-in specs.
Target: mipsel-unknown-linux-gnu
Configured with:
--prefix=/usr --bindir=/usr/mipsel-unknown-linux-gnu/gcc-bin/4.4.0-alpha20080912
--host=mipsel-unknown-linux-gnu --target=mipsel-unknown-linux-gnu
--build=i686-pc-linux-gnu --disable-altivec --enable-nls
--without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-multilib --enable-libmudflap
--disable-libssp --enable-cld --disable-libgcj --enable-languages=c,c++
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.4.0_alpha20080912'
Thread model: posix
gcc version 4.4.0-alpha20080912  (experimental) (Gentoo 4.4.0_alpha20080912) 

A little test .c file:
2f ~ # cat test.c 
#include <limits.h>

the result of preprocessing:
2f ~ # gcc -E test.c 
# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"
# 1
# "/usr/lib/gcc/mipsel-unknown-linux-gnu/4.4.0-alpha20080912/include-fixed/limits.h"
# 1 3 4
# 1 "test.c" 2

Zhang Le

More information about the Gcc mailing list