linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: linux-sparse@vger.kernel.org
Subject: sparse context tags
Date: Mon, 12 Mar 2007 18:37:34 -0400	[thread overview]
Message-ID: <ee9e417a0703121537p49657eai662b3dce82c7af5d@mail.gmail.com> (raw)

Is the optional leading context argument
(the x in __attribute__((context(x, 0, 1)))
documented anywhere?  Apologies if this is
a FAQ, but I've looked.

Failing that, can someone enlighten me about
why sparse doesn't find any problems with
the function bad() below?  I am using sparse-0.2.

Thanks.
Russ

---

#define __acquires(x) __attribute__((context(x, 0, 1)))
#define __releases(x) __attribute__((context(x, 1, 0)))

typedef struct redlock redlock_t;
typedef struct bluelock bluelock_t;

void redlock(redlock_t *r) __acquires(r);
void redunlock(redlock_t *r) __releases(r);

void bluelock(bluelock_t *b) __acquires(b);
void blueunlock(bluelock_t *b) __releases(b);

void
bad(redlock_t *r, bluelock_t *b)
{
	redlock(r);
	blueunlock(b);
}

             reply	other threads:[~2007-03-12 22:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 22:37 Russ Cox [this message]
2007-03-13  0:32 ` sparse context tags Christopher Li
2007-03-13  1:31   ` Pavel Roskin

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=ee9e417a0703121537p49657eai662b3dce82c7af5d@mail.gmail.com \
    --to=rsc@swtch.com \
    --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).