linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sparse context tags
@ 2007-03-12 22:37 Russ Cox
  2007-03-13  0:32 ` Christopher Li
  0 siblings, 1 reply; 3+ messages in thread
From: Russ Cox @ 2007-03-12 22:37 UTC (permalink / raw)
  To: linux-sparse

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);
}

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

end of thread, other threads:[~2007-03-13  1:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-12 22:37 sparse context tags Russ Cox
2007-03-13  0:32 ` Christopher Li
2007-03-13  1:31   ` Pavel Roskin

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).