I've recently found a strange piece of C syntax in our codebase which I can't quite explain... (simplified version below)
#define ARR(a, i) (*({assert(i>0); &arr;}))
Note the semicolons and {} in the definition!
Is this code standard C ? What is this behaviour called?
It definitely compiles and runs as expected with gcc.
I'd only have known hot to write this using the comma-operator:
#define ARR(a, i) (*(assert(i>0), &arr))
Just wondering, how much of the C standard I don't know...
Phobon