3 ms·
The standard massively conflicts with the practices used in existing C programs by existing C programmers. Yes, it's perfectly possible to write code that doesn
by platinumrad 8y ago
The standard massively conflicts with the practices used in existing C programs by existing C programmers. Yes, it's perfectly possible to write code that doesn't violate any of the (largely implicit, it's worth noting) strict-aliasing rules. But was it a good idea for the standard to allow optimizing compilers to silently break massive amounts of existing code that has worked for years? Even if that were acceptable, was it a good idea for the standard to disallow one of the more ergonomic and explicit ways (using a union) of reinterpreting an object as an object of a different type?
Some good reads on this topic:
https://blog.regehr.org/archives/1307 https://blog.regehr.org/archives/1307
http://www.yodaiken.com/2018/05/20/depressing-and-faintly-terrifying-days-for-the-c-standard/ http://www.yodaiken.com/2018/05/20/depressing-and-faintly-te...
https://blog.regehr.org/archives/903 https://blog.regehr.org/archives/903 (See the end of Xavier Leroy's comment)