🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Mitchell Perilstein Thu, 07 Jan 1993 17:07
Mismatched function storage class not reported--OK?
#1603
Author: Mitchell Perilstein
Date: Thu, 07 Jan 1993 17:07
26 lines
1174 bytes
If this file

  static int foo();

  int foo() 
  {
	return 1;
  }

is compiled -Wall -c, no warning is issued regarding mismatched storage
class between the declaration and the definition.  The function is taken
to be static, as shown by nm on the result (`t' indicates static symbol
in SunOS nm):

  00000000 t _foo
  00000000 t gcc2_compiled.

Taking foo as static is OK, since the first external declaration
specifies static.  The Standard describes how the types must all match
up, but what does it say about storage classes? Should a warning be
issued? 

This is gcc 2.1 on Sun4 SunOS 4.1.2.
---
 Mitchell N. Perilstein   CAD Language Systems, Inc.   410-992-5700 x225 
 Member, League for Programming Freedom.  Mail lpf@uunet.uu.net for info.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads