4 ms·
I'm really confused by the 1s in this macro. What are they, syntactically? The second one looks like it could be being cast to the type "pointer to y" but the f
by drngdds 9y ago
I'm really confused by the 1s in this macro. What are they, syntactically? The second one looks like it could be being cast to the type "pointer to y" but the first one has the sizeof expression in front of it.
#define __typecheck(x, y) \
(!!(sizeof((typeof(x)*)1 == (typeof(y)*)1)))
- ivanbakel 9y agoBoth are being cast - the brackets are a little confusing, but the sizeof expression is for the result of the comparison.