Open davidebeatrici opened 3 years ago
The USE_MALLOC name is a bit confusing, as the code of course use mallom even if USE_MALLOC is not defined... What about HAVE_VLA_SUPPORT or something like that instead? Is there some flag in modern C that can be used to detect compilers with such advanced feature available without manually setting a flag?
According to https://stackoverflow.com/a/49988810 we can use __STDC_NO_VLA__
.
Should I do that?
[Davide Beatrici]
Should I do that?
I have no idea who would make such decision, but for what it is worth, I believe it is a better idea to automatically detect the need than to depend on a manually set flag. So if it was up to me, I would do it. :) -- Happy hacking Petter Reinholdtsen
Here's my own take on a fix: https://github.com/xiph/rnnoise/pull/219
Relevant differences:
__STDC_NO_VLA__
to automatically determine VLA support
NO_VLA
if the automatic detection doesn't work with their toolchainstackalloc
abstraction so we don't need the ifdefs
all over the sourceCan you give the upgrade1 branch a try. The VLAs should all be replaced with fixes sizes.
This is required for MSVC.