[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lib/dirent.in.h fails on AIX
From: |
Albert Chin |
Subject: |
Re: lib/dirent.in.h fails on AIX |
Date: |
Thu, 6 Nov 2008 09:46:56 -0600 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Tue, Nov 04, 2008 at 02:01:11AM +0100, Bruno Haible wrote:
> Gary V. Vaughan wrote:
> > Unfortunately, this compiler and the IBM compiler on aix4.3.3 and aix6.1.0
> > (but
> > strangely, not 5.1, 5.2 or 5.3) have another peculiar behaviour which
> > breaks on
> > some headers when include_next.m4 determines that #include_next doesn't
> > work.
> >
> > $ echo '#include <stdio.h>' > conftest.c
> > $ xlc -E conftest.c | grep stdio
> > #line 73 "/usr/include/stdio.h"
> > int __stdioid;
> > #line 259 "/usr/include/stdio.h"
> > #line 374 "/usr/include/stdio.h"
> > #line 398 "/usr/include/stdio.h"
> > #line 434 "/usr/include/stdio.h"
> > $ echo '#include <dirent.h>' > conftest.c
> > $ xlc -E conftest.c | grep dirent
> > struct dirent {
> > extern struct dirent *readdir(DIR *);
> > extern int readdir_r(DIR *, struct dirent *, struct dirent **);
> > extern int scandir(const char *, struct dirent ***,
> > int (*)(struct dirent *),
> >
> > It seems that the compiler sometimes forgets the #line directives.
>
> Thanks for the report. It appears that because the header file
> <dirent.h> contains only comments and preprocessor directives, and no
> non-comment tokens of its own, AIX xlc "optimizes" some #line
> directives.
>
> [[ snip snip ]]
>
> Fortunately, GCC and the system compilers on HP-UX, IRIX, OSF/1,
> Solaris don't "optimize" the #line directives like this. So only the
> system compilers on AIX are affected.
>
> The fix that I found is to use "xlc -E -C" instead of "xlc -E". It has the
> effect of turning the config.status lines
>
> S["NEXT_SIGNAL_H"]="\"///usr/include/sys/signal.h\""
> S["NEXT_DIRENT_H"]="\"\""
>
> into
>
> S["NEXT_SIGNAL_H"]="\"///usr/include/signal.h\""
> S["NEXT_DIRENT_H"]="\"///usr/include/dirent.h\""
This doesn't always work. On AIX 6.1 with the IBM v10 compiler:
$ echo '#include <math.h>' > conftest.c
$ xlc -E -C conftest.c | grep math.h
#line 6 "/usr/vac/include/math.h"
#line 1 "/usr/include/math.h"
/* bos61B src/bos/usr/include/math.h 1.28.11.1
*/
/* "@(#)30 1.28.11.1 src/bos/usr/include/math.h, libm, bos61B, b2008_06B1
2/4/08 03:09:39" */
* COMPONENT_NAME: (LIBM) math header file
#line 92 "/usr/include/math.h"
* The ANSI standard requires that certain values be in math.h.
* ANSI required entries in math.h
* prototype in math.h.
#line 1324 "/usr/include/math.h"
#line 1358 "/usr/vac/include/math.h"
This results in:
S["NEXT_MATH_H"]="\"///usr/vac/include/math.h\""
But this is wrong. What we want is:
S["NEXT_MATH_H"]="\"///usr/include/math.h\""
else HUGE_VAL isn't found when lib/strtod.c is compiled.
Maybe we should use -C only when -E produces empty output?
--
albert chin (address@hidden)