Yes, and variable length arrays were made an optional part of the standard in C11. Whereas flexible array members remain a standard required feature.
Flexible array members don’t allocate a dynamic amount of memory on the stack.
Flexible array members don’t allocate a dynamic amount of memory on the stack.
#include <stdio.h>
#include <stddef.h>
void v(int y[printf("hello world!\n")]){
}
int main(){
v(NULL);
typedef int wut[printf("oh no\n")];
}
$ cc vla.c && ./a.out
hello world!
oh no
`typedef`s with side effects...