<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font face="arial, sans-serif">I want to extend the VLA size checker to recognize invalid conditions if the VLA is used through a typedef. But the typedef statement seems to be not evaluated, the VLA size value is not known by the analyzer.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">The following code produces a warning:</font></div><div><font face="monospace">void check_uninit_sized_VLA() {</font></div><div><font face="monospace">  int x;</font></div><div><font face="monospace">  int vla[x]; // expected-warning{{Declared variable-length array (VLA) uses a garbage value as its size}}</font></div><div><font face="monospace">}</font></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">But the following does not:</span><br></div><div><div><font face="monospace">void check_uninit_sized_VLA() {</font></div><div><font face="monospace">  int x;</font></div><div><font face="monospace">  typedef int VLA[x];</font></div><div><font face="monospace">  VLA vla; // </font>value of 'x' is Unknown here, why ?</div><div><font face="monospace">}</font></div><div><br></div><div>The `checkPreStmt` with `Decl*` is not called for `TypedefDecl`.</div><div>Similarly, at a `sizeof(VLA)`  in the code above `x` is always Unknown.</div><div>How is it possible (if it is) to obtain value of `x` in these cases, or find a way to check validity of the VLA in the typedef (or a `sizeof` call)?</div><div><br></div><div></div></div></div></div></div></div>