All Questions
Tagged with c-preprocessor gcc
2 questions
7
votes
2
answers
762
views
Consolidating GNU C's and C23's attributes
C23 has introduced attribute specifier sequences. Consequently, the header below attempts to conditionally define macros for these sequences (for my own use cases). In cases where a compiler does not ...
4
votes
1
answer
1k
views
Macro for counting number of elements in an array
We all know the classic version of counting the number of elements in a C array: sizeof(a)/sizeof(*a)
But this is dangerous, because if used on a pointer it will ...