linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: blp@cs.stanford.edu
Cc: linux-sparse@vger.kernel.org
Subject: Re: intended use of "safe"?
Date: Fri, 12 Aug 2011 10:47:11 -0700	[thread overview]
Message-ID: <CANeU7Qn25EWmDFuQRhr2_txEhF9hguh=SMUJnNYjLPnCR2MDNg@mail.gmail.com> (raw)
In-Reply-To: <874o1nzx8x.fsf@blp.benpfaff.org>

On Thu, Aug 11, 2011 at 10:14 AM, Ben Pfaff <blp@cs.stanford.edu> wrote:
> What is the intended use of the sparse "safe" attribute?  I do
> not see any uses of it in Linux (although there is a __safe macro
> for it).  I don't see any documentation for it either.

I don't know much about the safe attribute either. I find out the
commit which introduce the safe attribute by "git blame".

If a pointer is never NULL, there is not need to test the pointer.

Chris

commit 98f14350c26518f0f5c45632d145a218d468d8b8
Author: Linus Torvalds <torvalds@ppc970.osdl.org>
Date:   Fri Apr 16 18:19:30 2004 -0700

    Introduce "safe" pointer expressions.

    These are defined to never be NULL or nontrapping, and could
    help code generation, but right now only cause a warning if
    they are tested in a conditional.
--
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:[~2011-08-12 17:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 17:14 intended use of "safe"? Ben Pfaff
2011-08-12 17:47 ` Christopher Li [this message]
2011-08-12 17:58   ` Josh Triplett

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='CANeU7Qn25EWmDFuQRhr2_txEhF9hguh=SMUJnNYjLPnCR2MDNg@mail.gmail.com' \
    --to=sparse@chrisli.org \
    --cc=blp@cs.stanford.edu \
    --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).