Well, it's valid C in C99. ImportC is a C11 compiler. In C11, support for VLAs is optional. Compilers that don't support them are supposed to define the __STDC_NO_VLA__ macro.
Comment #2 by maxhaton — 2022-06-26T05:03:52Z
This could be lowered to something on the heap fairly easily I think.
Comment #3 by ryuukk.dev — 2022-06-26T09:03:55Z
why on the heap? it should be on the stack, i used alloca instead and i could compile the library
Comment #4 by ryuukk.dev — 2022-06-26T10:47:55Z
(In reply to Mike Parker from comment #1)
> Well, it's valid C in C99. ImportC is a C11 compiler. In C11, support for
> VLAs is optional. Compilers that don't support them are supposed to define
> the __STDC_NO_VLA__ macro.
Thanks, i sent a PR on that library's repo and left a note about this macro
Should this be marked as resolved?
Comment #5 by aldacron — 2022-06-26T11:09:01Z
No, please leave it open. Walter will have to decide which way to go with this.
Comment #6 by dlang-bot — 2022-07-07T06:53:26Z
@WalterBright created dlang/druntime pull request #3872 "fix Issue 23213 - ImportC - variable length array does not compile" fixing this issue:
- fix Issue 23213 - ImportC - variable length array does not compile
https://github.com/dlang/druntime/pull/3872
Comment #7 by dlang-bot — 2022-07-07T07:47:15Z
dlang/druntime pull request #3872 "fix Issue 23213 - ImportC - variable length array does not compile" was merged into master:
- dee0164ae940f39a588fc9e135ece355e8e875ed by Walter Bright:
fix Issue 23213 - ImportC - variable length array does not compile
https://github.com/dlang/druntime/pull/3872