Re: [PATCH v2 02/26] block: Annotate the block device functions

Marco Elver
2026-03-30T12:34:03Z

On Fri, 27 Mar 2026 at 19:28, Bart Van Assche <bvanassche@acm.org> wrote:
>
> On 3/27/26 11:17 AM, Marco Elver wrote:
> > No that's not supported (yet). There are various design options, each
> > with their own pros/cons: the one question is if attributes should
> > behave more like type qualifiers in this case (enforces functions to
> > match), or just be a best-effort thing (functions may not match
> > function pointer).
>
> It would be great if lock context annotations would be integrated in the
> function pointer type because today these annotations are lost if one
> function pointer is assigned to a function pointer variable.
>
> Maybe there is something that I'm overlooking?

The system was designed with attributes (for optionality).
Changing it to treat attributes more like type qualifiers will beg the
question: "why not make it a real type qualifier?" from the Clang
maintainers. And getting that right is very tricky, as it's a
fundamental and rather intrusive change.
I can explore the attribute based design, but if that's rejected, I
think we'll have to leave it at that for now.