[cfe-dev] -Wvla triggered even for C99 code
Michael Weller (BLOOMBERG/ LONDON) via cfe-dev
cfe-dev at lists.llvm.org
Wed Dec 2 07:33:57 PST 2015
According to my understanding, variable-length arrays were added in C99, yet clang warns on their use via the -Wvla warning:
unsigned int size = 123;
$ clang -Weverything -c -std=c99 test.c
test.c:5:13: warning: variable length array used [-Wvla]
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev