TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The value of undefined behavior

24 点作者 OberstKrueger将近 7 年前

1 comment

andreareina将近 7 年前
The trouble is checking for undefined behavior (is adding these two ints going to result in overflow?) without triggering said undefined behavior. Ideally the checks would either be available as a function defined by the spec so that the compilers can do the right thing depending on the architecture. Failing that the compilers would have to pattern-match common idioms like they do for other situations like exchanging two variables, rotating shifts, etc.