On Sat, Sep 07, 2024 at 07:50:29AM +0200, Martin Uecker wrote:
> > 2. Apple's implementation supports expressions in the '__counted_by'
> > attribute, thus the 'count' may be an R-value that can't have its
> > address taken.
> >
> > [1]
> > https://discourse.llvm.org/t/rfc-introducing-new-clang-builtin-builtin-get-counted-by/80836/
>
> Yes, this would be a limitation.
But then you really can't return an lvalue either, all you can return is an
rvalue in that case. So just return a (void*)0 in that case.
Jakub