13 ms·
> The size of the array needs to be known at compile time. In C99 the example you give does indeed compile and silently get turned into a VLA.
by jancsika 7y ago
> The size of the array needs to be known at compile time.
In C99 the example you give does indeed compile and silently get turned into a VLA.
- lochsh 7y agoIt would only be a VLA if defined in a block, I intended the code snippet to be at file-scope, giving the buffer size and array static storage duration. But it does indeed compile in Clang, and I'm looking into why. I think this line in the C11 standard might be key: "An implementation may accept other forms of constant expressions."