This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]