[cfe-dev] [RFC] Control -Wvla for conformant parameters

Arthur O'Dwyer via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 8 09:10:37 PST 2021


On Mon, Nov 8, 2021 at 12:04 PM Aaron Ballman <aaron at aaronballman.com>
wrote:

> On Mon, Nov 8, 2021 at 11:11 AM Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
> wrote:
> >
> > IIUC, Clang currently misdiagnoses
> > https://godbolt.org/z/6x7399eqP
> >     return sizeof(int (*)(int[n]));  // -Wvla warns here (wrongly)
> > because `int (*)(int[n])` is not a variably modified type — is that
> right? So it would be cool to clean up some of this code at the same time.
>
> I'd have to stare at the C standard a while to be sure, but I think
> that is a variably modified type, but is not a VLA. Regardless, I
> agree that there's likely terminology that needs to be cleaned up as
> part of this.
>

IIUC, `int (*)(int[n])` is the same type as `int (*)(int*)` — and yes, I
should have thought to spell that out clearly in my first message. :)

–Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211108/4ce0fbb4/attachment-0001.html>


More information about the cfe-dev mailing list