This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: HP-UX header file fixup.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: dave at hiauly1 dot hia dot nrc dot ca
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 May 2006 10:38:42 -0700 (PDT)
- Subject: Re: Patch: HP-UX header file fixup.
> > When compiling programs on HP-UX 11.23 platforms with
> > -D_FILE_OFFSET_BITS=64 the /usr/include/sys/socket.h header file will
> > declare sendfile and sendpath as extern and then as static. The HP
> > compiler gives a warning on this but GCC gives a hard error.
>
> I have no problem with the patch but giving a hard error in a
> system header is annoying if GCC could handle this as a warning.
Is that an approval for checkin?
It looks like GCC changed this from a warning to an error in the 4.0
time frame. 3.4.5 gives a warning on extern function declarations
followed by a static declaration, 4.0.2 gives an error. I tried to
track down the version where it changed and I think it happened at svn
version 84046 (gcc/c-decl.c). There isn't a clear explanation of the
change, just that the behaviour is undefined according to the C standard.
Steve Ellcey
sje@cup.hp.com