This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc 2.95.1 problem with 64-bit off_t and __STDC_EXT__ in HP-UX 10.20
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcc 2.95.1 problem with 64-bit off_t and __STDC_EXT__ in HP-UX 10.20
- From: Paul Eggert <eggert at twinsun dot com>
- Date: Wed, 22 Sep 1999 00:28:52 -0700 (PDT)
- CC: pausmith at nortelnetworks dot com
Paul D. Smith reports that GNU make 3.77.95 doesn't build with GCC 2.95.1
on HP-UX 10.20, with the following failure symptoms:
gcc10 -DHAVE_CONFIG_H -I. -I../../glob -I.. -I../glob -O2 -c ../../glob/glob.c
In file included from /usr/include/errno.h:6,
from ../../glob/glob.c:32:
/usr/include/sys/stdsyms.h:244: #error "Large Files (ILP32) not supported in strict ANSI mode."
We worked around the problem by compiling with -D__STDC_EXT__.
Dejanews reports that people have run into similar problems building
Samba and Berkeley DB on HP-UX 10.20 and later with gcc; they've
worked around the problem similarly.
I believe that the problem is that /usr/include/sys/stdsyms.h contains
the following code:
#if defined(__STDC_EXT__) || !defined(__STDC__) || defined(__LP64__)
...
#else /* strict ANSI */
# ifdef _FILE_OFFSET_BITS
# if !defined(__LP64__) && _FILE_OFFSET_BITS == 64
#error "Large Files (ILP32) not supported in strict ANSI mode."
# endif
# endif
# ifdef _LARGEFILE64_SOURCE
#error "Large File interfaces not supported in strict ANSI mode."
# endif
#endif /* __STDC_EXT__ || ! __STDC__ || __LP64__ */
GNU `make' needs access to large files, so it sets _FILE_OFFSET_BITS
to 64; this runs afoul of the above check with gcc 2.95.1, but not
with the HP compiler.
I suggest that GCC be modified on one of two ways:
1) Define __STDC_EXT__ as a builtin macro in HP-UX 10.20 and later,
unless --ansi is given.
or
2) Do not define __STDC__ in system headers in HP-UX 10.20 and later,
unless --ansi is given. This would be similar to the practice in
Solaris, where __STDC__ is 0 in system headers; it would differ in
that __STDC__ would be _undefined_ in system headers.
(2) sounds more plausible to me, but unfortunately I don't have access
to an HP-UX 10.20 or later box to test it. However, I thought I'd
report the situation as best I could; perhaps someone with access to
HP-UX 10.20 or later can take it from here.