🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #908

static functions with gcc -Wall

#908
From: Robert Lupton
Date: Sun, 21 Jan 1990 03:24
34 lines
1166 bytes
(A repost, with more explanation and example code)

The following code, compiled with gcc 1.36 (-Wall) complains
	`func', defined but not used.
at the start of the definition of func()

/**************************************************************/	
int
main()
{
   static void func();

   func();
   return(0);
}

static void
func()
{
   int printf();

   printf("Hello, World\n");
}
/**************************************************************/

The only way that I can get rid of this warning is to move the definition
of func above main() in the file, and remove the line `static void func()'.

This seems like a bug to me, as it means that I must move static little
functions to the top of the source file, ahead of the globally interesting
stuff.

			Robert
			
Technical Details
Message-ID: <6281@uhccux.uhcc.hawaii.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!sun-barr!ames!uhccux!lupton

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!sun-barr!ames!uhccux!lupton
From: lupton@uhccux.uhcc.hawaii.edu (Robert Lupton)
Newsgroups: gnu.gcc.bug
Subject: static functions with gcc -Wall
Keywords: gcc 1.36
Message-ID: <6281@uhccux.uhcc.hawaii.edu>
Date: 21 Jan 90 03:24:32 GMT
Organization: University of Hawaii
Lines: 34