c99 flexible array & libclang

Hi,

I would like to analyze some code using libclang python bindings.
However, c99 flexible arrays always have 'unexposed' type.

Is there a way to get element type ?

thanks,
Mickaël.

The solution is to fix libclang to expose the type. Please either file a PR requesting this or to supply a patch. Thanks!

incompletearray.diff (2.88 KB)

-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

you already can distinguish between foo and foo[0] : they don't have the same type (IncompleteArray vs ConstantArray)