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: Abolish 'static' functions in local scope


On Mon, 30 Aug 2004, Geoffrey Keating wrote:

> 	* c-decl.c (grokdeclarator): Produce error for 'static' on local
> 	function declaration.

There's more cleanup possible (at least the code in pushdecl that checks 
for this case, and some bits of diagnose_mismatched_decls, provided you 
get rid of the static so that subsequent processing of invalid code 
doesn't need to care for that case).

> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/gcc.dg/funcdef-storage-1.c	30 Aug 2004 21:57:30 -0000
> @@ -0,0 +1,14 @@
> +/* { dg-do compile } */
> +

This test needs { dg-options "" }, otherwise it gets the default -ansi 
-pedantic-errors and so tests nothing about the patch.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
  http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 3.5
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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