3 ms·
Does it matter unless you're reading a float from varargs? What else can it break?
by oguz-ismail 2y ago
Does it matter unless you're reading a float from varargs? What else can it break?
- josephcsible 2y agoI don't know exactly what, but I know there is more than just that, because calling printf breaks with a misaligned stack even when you're not passing it any floating-point arguments. And even if it doesn't break anything for you today, you're basically committing UB by violating the compiler's assumptions.
- ptspts 2y agoAren't there GCC command-line flags to specify alignment assumptions?
- josephcsible 2y agoYes (see https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.ht...), but this article doesn't use them.
- saagarjha 2y agoCode that uses vector registers