你见过哪些惊世骇俗的垃圾代码

泻药。没有见过。附新鲜出炉的 GCC 6 的changelog一则。Value range propagation now assumes that the this pointer of C++ member functions is non-null. This eliminates common null pointer checks but also breaks some non-conforming code-bases (such as Qt-5, Chromium, KDevelop). As a temporary work-around -fno-delete-null-pointer-checks can be used. Wrong code can be identified by using -fsanitize=undefined.所以我日常生活里几乎使用频率最高的三个程序,依赖于this可以是null时的undefined behavior在特定编译器下的行为……?
■网友
if (xxx==true){ for(int i=0;i\u0026lt;100;i++) { save(); }}
■网友
【你见过哪些惊世骇俗的垃圾代码】 时间排序


    推荐阅读