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

Really?! How do you specify alignment and packing in ANSI C?


_Alignof( ) and _Alignas( )?


Yeah, since C11 only.

However very few compilers, specially in the embedded and real time OS space do offer C11 compliance.

Gcc and clang aren't the only game in town. If one aims to write compliant C code much more compilers come into the picture.


Isn't it that if you write standard compliant C code, much less compilers come into the picture ;)


No, there is C89, C99 and C11.

What reduces the set of compilers is the reliance on compiler specific behaviours or recently approved standards, when compilers are still catching up.




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

Search: