linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Christopher Li" <sparse@chrisli.org>
To: Pavel Roskin <proski@gnu.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: label 'continue' already bound, unreplaced symbol 'return'
Date: Fri, 22 Feb 2008 11:16:39 -0800	[thread overview]
Message-ID: <70318cbf0802221116i229152d1wafc15442cd0ab2d3@mail.gmail.com> (raw)
In-Reply-To: <1202948215.8941.37.camel@dv>

>  static inline int foo(void)
>  {
>     do {
>     } while (0);
>     return 0;
>  }
>  int bar(void);
>  int bar(void)
>  {
>     return foo();
>  }
>  typeof(bar) quux;
>
>
>  hal.c:12:13: warning: symbol 'quux' was not declared. Should it be
>  static?
>  hal.c:3:5: warning: label 'continue' already bound
>  hal.c:3:5: warning: label 'break' already bound

This happen because you try to make quux has type of *function*,
not a function pointer. Sparse literary assign the base type of bar
as base  type of quux. This result in body of bar get linearized twice.

I don't thing typeof(bar) quux is doing any thing useful.
I am not sure what is the gcc rules here. I try gcc -S with the test
case, it does not even generate any thing for quux.

The rest of the test case is more or less the same thing.

>  "extern" before "typeof" fixes all warnings.

That is because, once you declear it as "extern", it does not emit
any code.

I guess I can skip typeof(function) to fix it, like gcc does. Is there
better suggestions?

Chris

      reply	other threads:[~2008-02-22 19:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14  0:16 label 'continue' already bound, unreplaced symbol 'return' Pavel Roskin
2008-02-22 19:16 ` Christopher Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70318cbf0802221116i229152d1wafc15442cd0ab2d3@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=proski@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).