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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why C Function Macros Are Bad

1 点作者 paedubucher超过 6 年前

1 comment

gus_massa超过 6 年前
Bad macros are bad. In case the arguments appear twice, you must create an intermediate variable to hold the result. This is also important to ensure that all the arguments are evaluated in the correct order.<p>With a Google Search I found this example that is more clear and has working code (using a GNU C extension): <a href="https:&#x2F;&#x2F;gcc.gnu.org&#x2F;onlinedocs&#x2F;cpp&#x2F;Duplication-of-Side-Effects.html" rel="nofollow">https:&#x2F;&#x2F;gcc.gnu.org&#x2F;onlinedocs&#x2F;cpp&#x2F;Duplication-of-Side-Effec...</a>