3 ms·
I've always found it unsurprising that people find typedefs confusing. They're a storage specifier, which allows for some questionable constructs: int type
by gsg 15y ago
I've always found it unsurprising that people find typedefs
confusing. They're a storage specifier, which allows for some questionable constructs:
int typedef x;
typedef what;
struct { int x; } typedef *x, y;
enum { x } typedef;
Storage specifiers are pretty weird. This nonsense is allowed at function or parameter list scope, but not file scope:
void f() { enum { x } register; }
void f(enum { x } register);
I've never understood why Ritchie designed C's declaration syntax to have so many dumb edge cases.