4 ms·
C++ has struct & typedef and things work quite naturally. It always seemed like an obvious thing to bring to C, but I'm not sure about the nuances of the rules
by WickedSmoke 3y ago
C++ has struct & typedef and things work quite naturally. It always seemed like an obvious thing to bring to C, but I'm not sure about the nuances of the rules governing this.
- uecker 3y agoC++ had this forever (I assume), but for C this would be a breaking change which we try very hard to avoid.
- WickedSmoke 3y agoCould you please give an example of what would break? Perhaps I'm being dense, but it seems a new C standard supporting this would still compile existing code just as C++ can.
- keyneus 3y agoIn C, it's perfectly legal to do this: struct S { ... }; typedef int S; That's not valid in C++ (so would be a breaking change in C, if it were to adopt this). I don't really think changing this in C would break all that much code, but it's definitely not backwards compatible.