static followed by non-static fails to give a warning.

L. Peter Deutsch ghost@aladdin.com
Sat Jan 16 07:43:00 GMT 1999


> > 	static void f(void);
> > 	void f(void) { }
> 
> 	There was some discussion about when to activate it and I
> think the consensus was to put it in -Wtraditional.  

I've now researched this question more fully myself.

Unfortunately, a careful reading of sections 3.1.2.2 and 3.5 of the ANSI C
standard has led me to conclude that gcc is, in fact, doing what the
standard calls for.  I don't like this, since a significant number of other
compilers disagree, but it does seem to be the case.

I would still very much like to see a warning for this, as an aid to
portability, and I agree that -Wtraditional is a good way to activate it.
Thanks for following up.

-- 

L. Peter Deutsch         |       Aladdin Enterprises :::: ghost@aladdin.com
203 Santa Margarita Ave. | tel. +1-650-322-0103 (AM only); fax +1-650-322-1734
Menlo Park, CA 94025     |        http://www.cs.wisc.edu/~ghost/index.html

This e-mail message, including the header, is Copyright(C) 1999 L. Peter
Deutsch.  All rights reserved.  Use or dissemination on any distribution
list of any e-mail address that appears above is prohibited without specific
prior written permission.



More information about the Gcc-bugs mailing list