You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 sphincs/sphincsplus#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?
The text was updated successfully, but these errors were encountered:
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.
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 usesalloca
on platforms that don't. See also for example sphincs/sphincsplus#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?
The text was updated successfully, but these errors were encountered: