Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Madagascar's user avatar
  • 10.1k
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 ...
klutt's user avatar
  • 903