This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
cpp found limits.h in FIXED_INCLUDE_DIR, but not in STANDARD_INCLUDE_DIR
- From: Zhang Le <r0bertz at gentoo dot org>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 16 Sep 2008 00:10:09 +0800
- Subject: cpp found limits.h in FIXED_INCLUDE_DIR, but not in STANDARD_INCLUDE_DIR
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.
/usr/lib/gcc/mipsel-unknown-linux-gnu/4.4.0-alpha20080912/include-fixed/limits.h
(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
is before STANDARD_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:
/var/tmp/portage/sys-devel/gcc-4.4.0_alpha20080912/work/gcc-4.4-20080912/configure
--prefix=/usr --bindir=/usr/mipsel-unknown-linux-gnu/gcc-bin/4.4.0-alpha20080912
--includedir=/usr/lib/gcc/mipsel-unknown-linux-gnu/4.4.0-alpha20080912/include
--datadir=/usr/share/gcc-data/mipsel-unknown-linux-gnu/4.4.0-alpha20080912
--mandir=/usr/share/gcc-data/mipsel-unknown-linux-gnu/4.4.0-alpha20080912/man
--infodir=/usr/share/gcc-data/mipsel-unknown-linux-gnu/4.4.0-alpha20080912/info
--with-gxx-include-dir=/usr/lib/gcc/mipsel-unknown-linux-gnu/4.4.0-alpha20080912/include/g++-v4
--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