Revisit VLAs?
Variable-length arrays are kind of annoying not to have. We might extend compat.h with a macro that implements VLAs on platforms that support them, and uses alloca on platforms that don't. See also for example https://github.com/sphincs/sphincsplus/pull/26.
Of course, that might be prohibitive for any applications that don't have alloca. But the way we currently work around VLAs in SPHINCS+ is extremely terrible for legibility as well.
Do we want to allow VLAs, using a macro so that they will work on MSVC?
I've never seen alloca before. It looks like garbage collection? But if I understand correctly, only within the function. Will that suffice for our needs?
I'm not opposed in principle to variable length arrays, more just wanting to ensure we have something that builds on our target compilers.
As far as I understand, char* array = alloca(n); basically just pushes the stack pointer down in the same way that char array[n]; would do (though of course the C standard doesn't define the stack but only defines "automatic memory", so it won't phrase it as such...).
This will work for all of the desktop compiler that we target (VLAs only fail to work on MSVC) but I'm not sure about any embedded problems.