[clang] [clang] Emit bad shift warnings (PR #70307)

Stephan Bergmann via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 15 05:04:06 PDT 2024


stbergmann wrote:

This started to cause
```
$ cat test.c
#include <string.h>
void f(void) {
    char a[strlen("x")];
    (void) a;
}
```
```
$ clang -Wall -fsyntax-only test.c
test.c:3:12: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant]
    3 |     char a[strlen("x")];
      |            ^~~~~~~~~~~
1 warning generated.
```
to emit a warning, and I'm not sure that's intentional?

https://github.com/llvm/llvm-project/pull/70307


More information about the cfe-commits mailing list