difference between c99 and c11 [closed]

Good overviews of C11 standard: https://en.wikipedia.org/wiki/C11_(C_standard_revision) http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf https://smartbear.com/blog/test-and-monitor/c11-a-new-c-standard-aiming-at-safer-programming/ The standard includes several changes to the C99 language and library specifications, such as: Alignment specification (_Alignas specifier, _Alignof operator, aligned_alloc function, <stdalign.h> header file) The _Noreturn function specifier and the <stdnoreturn.h> header file Type-generic expressions using the _Generic keyword. For example, the following macro cbrt(x) translates …

Read more

How to find my current compiler’s standard, like if it is C90, etc

This is compiler dependent, I’m supposing you’re using GCC. You could check your compiler defined macros using: gcc -dM -E – < /dev/null Check the manual about the flags, specially: ###__STDC_VERSION__### This macro expands to the C Standard’s version number, a long integer constant of the form yyyymmL where yyyy and mm are the year …

Read more

Why does sizeof(x)++ compile? [duplicate]

The sizeof is an operator, not a function, and as any operator it has a precedence, which is in C lower than of the ++ operator. Therefore the construct sizeof(a)++ is equivalent to sizeof a++ which is in turn equivalent to sizeof (a++). Here we have postincrement on a which is an lvalue so it …

Read more