Join Nostr
2026-10-21 20:58:06 UTC

stf on Nostr: i feel like VLA in structs is actually a good thing in very specific conditions. I ...

i feel like VLA in structs is actually a good thing in very specific conditions. I have to construct a blob that contains - among others - multiple length-prefixed string components, why cannot i declare a const fn local struct variable that is immediately initialized? instead i have to calculate the final size of a buffer myself, and then do ptr acrobatics to memcpy() everything in place, or ugly macros. the former is easy to understand and audit, the latter are a nightmare in comparison.

#c