[cfe-dev] c99 flexible array & libclang

Matthieu Monrocq matthieu.monrocq at gmail.com
Sun Mar 18 04:12:55 PDT 2012


Le 17 mars 2012 17:39, Mickaël Guérin <kael at crocobox.org> a écrit :

>
> Le 16 mars 2012 à 22:02, Ted Kremenek a écrit :
>
> > The solution is to fix libclang to expose the type.  Please either file
> a PR requesting this or to supply a patch.  Thanks!
>
>
>
>
> Here is a patch :)
>
> clang_getNumElements and clang_getArraySize return -1 for incomplete
> arrays, I don't know whether it's good or not.
> (-1 or 0 seem to be two possible choices)
>
> --
> Mickaël.
>
> -1 seems better to me as arrays of size explicitly set to 0 are possible
(and were indeed used prior to the introduction of flexible arrays), so -1
gives the opportunity to distinguish between `[]` and `[0]`.

-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120318/58063c33/attachment.html>


More information about the cfe-dev mailing list