Re:Problems of C, and how Zig addresses them
by pornel on Monday July 03, 2023 @09:01PM
(#36580830)
If C made this change, it could also make it legal to redefine u32 etc as appropriate integer types any number of times without erring.
[ Parent
| on HN ]
Re:Problems of C, and how Zig addresses them
by saagarjha on Monday July 03, 2023 @09:17PM
(#36580942)
foo.h defines i64 as “long” and bar.h defines it as “long long”. Now what?
Re:Problems of C, and how Zig addresses them
by kevin_thibedeau on Monday July 03, 2023 @11:37PM
(#36581911)
This would break legacy code. I had one employer with a bool type that was a 32-bit integer because of obscure alignment issues. This is why _Bool exists and the bool typedef has to be brought in explicitly with stdbool. You can't just go and usurp popular short type names. The standard reserved *_t and _[A-Z].+ for this purpose. People have been writing portable code with the expectation that future standards aren't going violate that promise and break things.
Re:Problems of C, and how Zig addresses them
by alexvoda on Friday July 07, 2023 @11:19AM
(#36633061)
This is just one of the reasons that new languages that dispense with outdated assumptions and insted make assumptions more suitable to our times are a good thing. C and C++ are really old and some things can not be fixed with libraries.