{"id":107073,"date":"2024-10-19T06:51:10","date_gmt":"2024-10-18T22:51:10","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=107073"},"modified":"2024-10-19T06:51:10","modified_gmt":"2024-10-18T22:51:10","slug":"wtf-linus-angry","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/wtf-linus-angry.html","title":{"rendered":"\u53d1\u751f\u4e86\u4ec0\u4e48\uff1fLinus \u53c8\u53d1\u6012\u4e86\uff1f"},"content":{"rendered":"

\u5728\u4e00\u4e2a Linux \u5185\u6838 4.18-rc1 \u7684 Pull Request \u4e2d\uff0c\u5f00\u53d1\u8005 Andy Shevchenko \u8868\u793a\u5176\u5728\u5bf9\u8bbe\u5907\u5c5e\u6027\u6846\u67b6\u8fdb\u884c\u66f4\u65b0\u65f6\uff0c\u79fb\u9664\u4e86 union \u522b\u540d\uff0c\u8fd9\u5f15\u53d1\u4e86 Linus \u7684\u66b4\u6012\u3002<\/p>\n

\u8fd9\u4e00\u6b21 Linus Torvalds \u53d1\u6012\u7684\u539f\u56e0\u5728\u4e8e Andy \u7ed9\u51fa\u7684\u79fb\u9664 union \u522b\u540d\u7684\u539f\u56e0\u662f\u201c\u6839\u636e\u6807\u51c6\u884c\u4e8b\u201d\u3002Linus \u56de\u590d\u90ae\u4ef6\u8ba4\u4e3a Andy \u8fd9\u6837\u7684\u89e3\u91ca\u7b80\u76f4\u5c31\u662f\u5783\u573e\uff0c\u5e76\u4e14\u8fd8\u5f88\u5371\u9669\uff0c\u4ed6\u89e3\u91ca\u4f7f\u7528 union \u522b\u540d\u672c\u8eab\u5176\u5b9e\u5c31\u662f\u4e00\u79cd\u5728 gcc \u4e2d\u7684\u4f20\u7edf\u548c\u6807\u51c6\uff0c\u751a\u81f3\u5b83\u5b9e\u9645\u4e0a\u5df2\u7ecf\u662f\u4e00\u79cd\u6210\u6587\u89c4\u5b9a\uff0c\u5e76\u5927\u9a82\u5bf9\u65b9\u767d\u75f4\uff0c\u540c\u65f6\u5927\u9a82 C \u6807\u51c6\u662f\u5783\u573e\uff0c\u8a00\u8f9e\u6fc0\u70c8\u3002<\/p>\n

\"\"<\/p>\n

\u201c\u4f60\u4e3a\u4ec0\u4e48\u505a\u51fa\u8fd9\u6837\u7684\u89e3\u91ca\u5462\uff0c\u4e0d\u8981\u8ddf\u6211\u8bf4\u4ec0\u4e48 C \u6807\u51c6\u63cf\u8ff0\u5f97\u4e0d\u6e05\u695a\uff0cC \u6807\u51c6\u6709\u65f6\u5c31\u662f\u4e00\u5768\u5c4e\u201d\uff0cLinus \u63a5\u7740\u89e3\u91ca\uff1a\u201c\u4f60\u6240\u8c13\u7684\u8fd9\u4e2a\u6807\u51c6\uff0c\u5b83\u5bf9\u4e8e\u522b\u540d\u89c4\u5219\u7684\u6307\u5bfc\u5b8c\u5168\u5c31\u662f\u9519\u8bef\u7684\uff01\u5b83\u9700\u8981\u88ab\u5b8c\u5168\u5730\u65e0\u89c6\uff0c\u5e76\u4e14\u6bcf\u4e2a\u7f16\u8bd1\u5668\u90fd\u8981\u4e3a\u8fd9\u6837\u8111\u6b8b\u7684\u6807\u51c6\u7ed9\u51fa\u76f8\u5e94\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u8fd9\u5c31\u662f\u6211\u4eec\u4f7f\u7528 -fwrapv \u548c -fno-strict-aliasing \u7684\u539f\u56e0\u3002\u800c\u4f60\u73b0\u5728\u7adf\u7136\u8bf4\u6839\u636e\u8fd9\u6837\u4e00\u4e2a\u6807\u51c6\u6765\u884c\u4e8b\uff0c\u4f60\u8fd9\u6837\u7684\u7406\u7531\u771f\u7684\u6ca1\u6709\u4efb\u4f55\u610f\u4e49\u3002\u201d<\/p>\n

Linus \u5168\u7a0b\u56f4\u7ed5 Andy \u7ed9\u51fa\u7684\u7406\u7531\u201c\u6839\u636e\u6807\u51c6\u884c\u4e8b\u201d\u8fdb\u884c\u62a8\u51fb\uff0c\u4ed6\u7684\u610f\u601d\u662f\u5f53\u6807\u51c6\u4e0e\u73b0\u5b9e\u548c\u4ee3\u7801\u7684\u53ef\u9760\u6027\u76f8\u51b2\u7a81\u65f6\uff0c\u90a3\u4e48\u6807\u51c6\u5c31\u662f\u4e0d\u91cd\u8981\u7684\uff0c\u201c\u6211\u4e00\u518d\u5f3a\u8c03\uff1a\u5f53\u6807\u51c6\u4e0e\u73b0\u5b9e\u76f8\u51b2\u7a81\u65f6\uff0c\u90a3\u6807\u51c6\u6587\u6863\u5c31\u662f\u536b\u751f\u7eb8\uff0c\u5b83\u5c31\u5b8c\u5168\u6ca1\u610f\u4e49\u3002\u4e8b\u5b9e\u4e0a\uff0c\u5728\u6211\u9762\u524d\u536b\u751f\u7eb8\u6bd4\u6807\u51c6\u6587\u6863\u8fd8\u6709\u7528\uff0c\u81f3\u5c11\u5b83\u53ef\u4ee5\u8ba9\u6211\u7684\u5c4e\u4e0d\u8638\u5230\u5c41\u80a1\u4e0a\u201d\uff0c\u90ae\u4ef6\u6700\u540e\u4ed6\u53c8\u5e73\u9759\u5730\u6307\u51fa\uff1a\u201c\u6807\u51c6\u4e5f\u9700\u8981\u8d28\u7591\u3002\u201d<\/p>\n

\"\"<\/p>\n

\u968f\u540e\u5728\u8ffd\u52a0\u7684\u7b2c\u4e8c\u5c01\u90ae\u4ef6\u4e2d\uff0cLinus \u8868\u793a\u4ed6\u5df2\u7ecf\u5c06 Andy \u7684 PR \u5408\u5e76\uff0c\u5e76\u4e14\u7279\u522b\u8bf4\u660e\u81ea\u5df1\u4e0d\u662f\u4e0d\u559c\u6b22\u4ed6\u7684\u4ee3\u7801\uff0c\u4f46\u662f\u4ed6\u8fd8\u662f\u201c\u8bed\u91cd\u5fc3\u957f\u201d\uff08\u8bed\u6c14\u5df2\u7ecf\u7f13\u548c\u4e86\u5f88\u591a\uff09\u5730\u89e3\u91ca\u5230\uff1a\u201c\u6211\u53ea\u662f\u771f\u7684\u5b8c\u5168\u65e0\u6cd5\u63a5\u53d7\u90a3\u79cd\u4e0d\u987e\u73b0\u5b9e\u7684\u5355\u65b9\u9762\u7684\u89e3\u91ca\u3002\u201d<\/p>\n

\u540c\u65f6\u4ed6\u4e5f\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u8bf4 Andy \u7ed9\u51fa\u8fd9\u6837\u7684\u7406\u7531\u662f\u5f88\u5371\u9669\u7684\uff0c\u4ed6\u8ba4\u4e3a\u8fd9\u7406\u7531\u542c\u8d77\u6765\u5c31\u50cf\u662f\u6b63\u786e\u7684\uff0c\u5bf9\u4e8e\u5f88\u591a\u4eba\u6765\u8bf4\uff0c\u767d\u7eb8\u9ed1\u5b57\u4e0a\u7684\u6240\u8c13\u6807\u51c6\u662f\u9700\u8981\u656c\u754f\u7684\uff0c\u4f46\u662f\u5982\u679c\u4e00\u4e9b\u4eba\u4e0d\u4e86\u89e3\u66f4\u591a\u7ec6\u8282\uff0c\u6bd4\u5982\u5728\u8fd9\u4ef6\u4e8b\u60c5\u4e2d\uff0c\u4ed6\u4e0d\u77e5\u9053\u5176\u5b9e union \u522b\u540d\u5c31\u662f gcc \u7684\u6807\u51c6\u505a\u6cd5\uff0c\u90a3\u4ed6\u5c31\u88ab\u8bef\u5bfc\u4e86\uff01\u201d\u6807\u51c6\u6709\u5b83\u53d1\u6325\u4f5c\u7528\u7684\u5730\u65b9\uff0c\u4f46\u662f\u5b83\u4e5f\u6709\u5c40\u9650\u201c\uff0cLinus \u6700\u540e\u5199\u9053\u3002<\/p>\n

Andy \u56de\u590d\u90ae\u4ef6\u8868\u793a\u8d5e\u540c Linus \u7684\u8bf4\u6cd5\uff0c\u540c\u65f6\u4ed6\u4e5f\u89e3\u91ca\u5176\u5b9e\u5728\u8bbe\u5907\u5c5e\u6027\u6846\u67b6\u4e2d union \u522b\u540d\u786e\u5b9e\u662f\u4e0d\u5408\u9002\u7684\uff0c\u6240\u4ee5\u624d\u5c06\u5b83\u79fb\u9664\uff0c\u800c\u539f\u56e0\u4e5f\u4e0d\u53ea\u662f\u4ed6\u4e4b\u524d\u8bf4\u7684\u201c\u6839\u636e\u6807\u51c6\u884c\u4e8b\u201d\uff0c\u4ed6\u5728\u591a\u4e2a\u539f\u56e0\u4e2d\u53ef\u80fd\u9009\u62e9\u4e86\u4e0d\u592a\u8bf4\u5f97\u8fc7\u53bb\u7684\u4e00\u4e2a\u3002<\/p>\n

\u6700\u540e Andy \u8fd8\u8865\u5145\u4e86 Linus \u5173\u4e8e\u201c\u547c\u5524\u6807\u51c6\u201c\uff08Appeal to Standards\uff09\u5728\u7f16\u7a0b\u4e0a\u5e94\u8be5\u88ab\u8ba4\u4e3a\u662f\u4e00\u79cd\u903b\u8f91\u8c2c\u8bef\u7684\u770b\u6cd5\uff0c\u4ed6\u8ba4\u4e3a\u8fd9\u4e0d\u4ec5\u4ec5\u53ea\u5c40\u9650\u4e8e\u7f16\u7a0b\u9886\u57df\u3002<\/p>\n

\"\"<\/p>\n

\u6b64\u6b21 Linus \u7684\u53d1\u98d9\uff0c\u603c\u51fa\u4e86\u4e00\u756a\u5927\u9053\u7406\uff0c\u6807\u51c6\u6709\u5b83\u7684\u7ea6\u675f\u4f5c\u7528\uff0c\u4f46\u4e5f\u662f\u6709\u4f5c\u7528\u6761\u4ef6\u7684\uff0c\u9053\u7406\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u4e0d\u7528\u8fc7\u591a\u5206\u6790\u3002\u4e0d\u53bb\u50cf Andy \u90a3\u6837\u8c08\u8bba\u5230\u5bbd\u6cdb\u7684\u9886\u57df\uff0c\u4f5c\u4e3a\u65e5\u5e38\u4f9d\u636e\u5404\u79cd\u6807\u51c6\u7f16\u7a0b\u6587\u6863\u884c\u4e8b\u7684\u7a0b\u5e8f\u5458\uff0c\u6b22\u8fce\u4f60\u7559\u8a00\u5410\u69fd\/\u8d5e\u7f8e\/...\u6807\u51c6\u7684\u90a3\u4e9b\u4e8b\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.cnbeta.com\/articles\/tech\/734911.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/wtf-linus-angry.html<\/a>\u7f16\u8f91\uff1a\u6e05\u84b8github\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5728\u4e00\u4e2a Linux \u5185\u6838 4.18-rc1 \u7684 Pull Request \u4e2d\uff0c\u5f00\u53d1\u8005 Andy Shevche […]<\/p>\n","protected":false},"author":317,"featured_media":3900,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-107073","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/107073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=107073"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/107073\/revisions"}],"predecessor-version":[{"id":293720,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/107073\/revisions\/293720"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/3900"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=107073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=107073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=107073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}