limits.h, PATH_MAX
Ingo Struck
ingo@ingostruck.de
Mon May 1 13:21:00 GMT 2006
Hi there,
James L. Cunning wrote:
> On a SuSE 9.1 system (with gcc 3.3.3), the build finishes, but the test
> compile fails with:
>
> + test '!' -d tmp
> + mkdir tmp
> + cd tmp
> + test x '!=' x
> + cat
>
+ /opt/crosstool/gcc-3.3.3-glibc-2.3.2/powerpc-750-linux-gnu/bin/powerpc-750-linux-gnu-gcc
> -static hello.c -o powerpc-750-linux-gnu-hello-static
> hello.c: In function `main':
> hello.c:4: error: `PATH_MAX' undeclared (first use in this function)
> hello.c:4: error: (Each undeclared identifier is reported only once
> hello.c:4: error: for each function it appears in.)
I have had the same issue, and imo it is hello.c
which is incorrect. Rejecting it is correct behaviour.
<limits.h> refers to the standard C header file,
which does not provide PATH_MAX
(see iso/iec 0899:1999, Section 5.2.4.1, Translation limits)
PATH_MAX is part of linux, provided by
<linux/limits.h>
So hello.c should correctly #include <linux/limits.h>
and it will compile.
So it does with my
gcc-3.4.6-glibc-2.3.6/i386-unknown-linux-gnu
build.
Regards
Ingo Struck
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list