Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not the sizes, the alignments.


Same thing in C though, the primitive types have the same alignment as their size.


That is true on some systems, but not a portable assumption by any means.

Edit:

st7: sizeof(uint32_t)=4, aligned(uint32_t)=1

msp430: sizeof(int)=2, alignof(int)= 1

Real old ARM: sizeof(double)=8, alignof(double)=4

OG M68k sizeof(char)=1, but struct align(char)=2




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: