linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: "Ahmed S. Darwish" <darwish.07@gmail.com>
Cc: Josh Triplett <josh@kernel.org>, linux-sparse@vger.kernel.org
Subject: Re: Warnings on global symbols accessed only from assembly code
Date: Thu, 11 Feb 2010 17:06:56 -0800	[thread overview]
Message-ID: <70318cbf1002111706n7011eecpdaeb8bb691f95087@mail.gmail.com> (raw)
In-Reply-To: <20100212000052.GA6837@laptop>

On Thu, Feb 11, 2010 at 4:00 PM, Ahmed S. Darwish <darwish.07@gmail.com> wrote:
> Hi,
>
> Is there a way to let sparse avoid emitting warnings like:
>
>   symbol 'X' was not declared. Should it be static?
>
> for global methods that are only accessed from assembly files?
>

You mean other than declare it as function prototype first?
No that I know of.

The reason behind sparse is that, if this function is shared,
it should shared by some header file and declared some where.

> The reason is that a declaration for such methods - which are usually
> bootstrap ones - can given the false impression of being used by some
> C code 'somewhere'.

Sparse does not care about who call those function, C code or asm code.
Sparse don't not actually link the program so it can't know this symbol is
actually externally used or not.

Personally, I don't see why you can't declare those functions even
if they are called from asm.

> Unfortunately the current `-Wno-decl' solution is a bit extreme: it
> turns off a very useful sparse feature (by design).

Right, the problem is that sparse can't tell which functions are used in
asm files and only skip warning on those.

Chris
--
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

  reply	other threads:[~2010-02-12  1:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  0:00 Warnings on global symbols accessed only from assembly code Ahmed S. Darwish
2010-02-12  1:06 ` Christopher Li [this message]
2010-02-12  1:47   ` Ahmed S. Darwish
2010-02-12  6:43     ` Christopher Li
2010-02-14  0:48       ` Ahmed S. Darwish

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=70318cbf1002111706n7011eecpdaeb8bb691f95087@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=darwish.07@gmail.com \
    --cc=josh@kernel.org \
    --cc=linux-sparse@vger.kernel.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).