-Wvla triggered even for C99 code

According to my understanding, variable-length arrays were added in C99, yet clang warns on their use via the -Wvla warning:

void foo(void);
void foo(void)
unsigned int size = 123;
char foo[size];

$ clang -Weverything -c -std=c99 test.c


test.c:5:13: warning: variable length array used [-Wvla]
char foo[size];

I found a test case for -Wvla on this (unofficial) mirror:


This shows that the warning is expected even in C99 mode:

// RUN: %clang_cc1 -std=c99 -fsyntax-only -verify -Wvla %s
// RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wvla %s

Is this correct? I notice -Wvla is only enabled by -Weverything, so is it experimental or not properly supported?


Correct. If you use it pre-C99, -Wvla-extension would (also) trigger.
Now why that warning is not part of -Wall, I don't know. There are
various policies that prohibit use of VLAs, that's why the option