This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59856] Support sparse-style context checking, used to validate locking correctness
- From: "josh at joshtriplett dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Nov 2015 22:36:39 +0000
- Subject: [Bug c/59856] Support sparse-style context checking, used to validate locking correctness
- Auto-submitted: auto-generated
- References: <bug-59856-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59856
--- Comment #11 from Josh Triplett <josh at joshtriplett dot org> ---
(In reply to Tom Tromey from comment #10)
> (In reply to Josh Triplett from comment #9)
>
> > > It might help to see exactly where __context__ is used in real code.
> >
> > A few patterns:
>
> Sorry, I wasn't very clear.
> It seems to me that __context__ must be used as a kind of annotation
> alongside some effect-ful statement. I'm curious what those statements
> are; and whether we could somehow annotate them directly.
> (I presume not since sparse didn't go that route, but I figured I'd ask.)
Such statements could potentially consist of inline assembly implementing a
lock. __context__ potentially helps when implementing things as a macro.
That said, if absolutely necessary, I could imagine using exclusively the
context attribute and appropriate static inlines with that attribute.