Re:Structures in C: From Basics to Memory Alignment
by lsof on Friday June 30, 2023 @03:01AM
(#36531467)
On that note, something that caught me off guard once is that C11 _Alignof and GCC __alignof__ can differ: for example in 32-bit x86 __alignof__(double) == 8 but _Alignof(double) == 4; however __alignof__(struct { double d; }) == 4. Apparently __alignof__ gives the preferred alignment whereas _Alignof gives the alignment required by ABI.
[ Parent
| on HN ]
There are no comments on this comment yet.