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: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: sje at cup dot hp dot com (Steve Ellcey)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 May 2006 15:32:25 -0400 (EDT)
- Subject: Re: Patch: HP-UX header file fixup.
> 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.
I see in the diff for 84046:
+ /* A non-static declaration (even an "extern") followed by a
+ static declaration is undefined behavior per C99 6.2.2p3-5,7.
The HP-UX system headers certainly aren't C99 compatible.
The documentation indicates that gnu89 is still the GCC default.
So, I still think that this change in behavior was too agressive.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)