linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Spurious symbol 'foo' was not declared
@ 2010-07-18 20:16 Morten Welinder
  2010-07-18 20:35 ` Josh Triplett
  0 siblings, 1 reply; 2+ messages in thread
From: Morten Welinder @ 2010-07-18 20:16 UTC (permalink / raw)
  To: linux-sparse

I think sparse issues a spurious warning about "static" for this program.
Right?

Morten

static void foo (int);
void foo (int a) { }

welinder@anemone:~> cgcc -Wall -c sss.c
sss.c:2:6: warning: symbol 'foo' was not declared. Should it be static?
sss.c:2: warning: ‘foo’ defined but not used
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Spurious symbol 'foo' was not declared
  2010-07-18 20:16 Spurious symbol 'foo' was not declared Morten Welinder
@ 2010-07-18 20:35 ` Josh Triplett
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Triplett @ 2010-07-18 20:35 UTC (permalink / raw)
  To: Morten Welinder; +Cc: linux-sparse

On Sun, Jul 18, 2010 at 04:16:37PM -0400, Morten Welinder wrote:
> I think sparse issues a spurious warning about "static" for this program.
> Right?
> 
> Morten
> 
> static void foo (int);
> void foo (int a) { }
> 
> welinder@anemone:~> cgcc -Wall -c sss.c
> sss.c:2:6: warning: symbol 'foo' was not declared. Should it be static?
> sss.c:2: warning: ‘foo’ defined but not used

The second warning comes from gcc, I think.  But yes, the first warning
represents a long-standing sparse bug; "static" in the prototype doesn't
propagate to the definition.

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-18 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-18 20:16 Spurious symbol 'foo' was not declared Morten Welinder
2010-07-18 20:35 ` Josh Triplett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).