🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #940

GCC 2.2.2 diagnoses each initialized parameter twice

#940
From: Paul Eggert
Date: Thu, 13 Aug 1992 20:57
34 lines
1332 bytes
For the erroneous program

	int main(argc) int argc = 0; { return 0; }

GCC 2.2.2 outputs the same diagnostic twice:

	t.c:1: parameter `argc' is initialized
	t.c:1: parameter `argc' is initialized

Here is a patch.

Thu Aug 13 20:53:00 1992  Paul Eggert  (eggert@twinsun.com)

	* c-decl.c (grokdeclarator): Remove duplicate diagnostic for
	initialized parameters; start_decl already does this.

===================================================================
RCS file: c-decl.c,v
retrieving revision 2.2.2.3
diff -c -r2.2.2.3 c-decl.c
*** c-decl.c	1992/08/11 19:43:13	2.2.2.3
--- c-decl.c	1992/08/13 20:53:00
***************
*** 3950,3958 ****
  	    volatilep = constp = 0;
  	  }
  
- 	if (initialized)
- 	  error ("parameter `%s' is initialized", name);
- 
  	decl = build_decl (PARM_DECL, declarator, type);
  	if (size_varies)
  	  C_DECL_VARIABLE_SIZE (decl) = 1;
--- 3950,3955 ----
Technical Details
Message-ID: <9208132057.AA29363@farside.twinsun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!twinsun.COM!eggert

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!twinsun.COM!eggert
From: eggert@twinsun.COM (Paul Eggert)
Subject: GCC 2.2.2 diagnoses each initialized parameter twice
Message-ID: <9208132057.AA29363@farside.twinsun.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 13 Aug 1992 20:57:24 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 35