fuhsnn / slimcc

C11 compiler with GNU extensions for x86-64 Linux, working towards C23
MIT License
34 stars 4 forks source link

Variably-modified types in prototype scope (aka VLA parameters) #11

Closed fuhsnn closed 11 months ago

fuhsnn commented 11 months ago

As in recent regex.h, if __STDC_NO_VLA__ isn't defined, VM types in parameter are expected to work. This will be mandatory in C23.

int fn(int sz, char (*arr)[sz]) {
  return sizeof *arr; // should equal sz
}