🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2201

Possible bug when declaring static functions in 1.32

#2201
From: Shane P. McCarron
Date: Wed, 01 Feb 1989 17:20
29 lines
1208 bytes
I have run across something that I find curious.  The following code:

main()
{
	int broken();

	(void) broken();
	return(0);
}

static int
broken()
{
	return(0);
}

Causes gcc -c -pedantic to report:

gccbug.c: In function broken:
gccbug.c:11: warning: `broken' was declared `extern' and later `static'

However, if I try to declare the forward reference of the function
'static int broken()', I get an 'invalid storage class specifier'
warning.  Am I doing something wrong, or does gcc 1.32 have a problem
here.  And if it is me, then how can I forward reference a function
that has translation unit scope?
--
Shane P. McCarron			ATT:	+1 612 452-9522
Project Manager				UUCP:	ahby@c2s.mn.org
Technical Details
Message-ID: <1054@com50.C2S.MN.ORG>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!nic.MR.NET!shamash!com50!com2serv!ahby

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!nic.MR.NET!shamash!com50!com2serv!ahby
From: ahby@com2serv.c2s.mn.org (Shane P. McCarron)
Newsgroups: gnu.gcc.bug
Subject: Possible bug when declaring static functions in 1.32
Message-ID: <1054@com50.C2S.MN.ORG>
Date: 1 Feb 89 17:20:09 GMT
Sender: usenet@com50.C2S.MN.ORG
Reply-To: ahby@com2serv.c2s.mn.org (Shane P. McCarron)
Distribution: usa
Organization: Com Squared Systems, St. Paul, MN
Lines: 29