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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Detecting integer constant expressions in macros

79 点作者 BtdTom大约 7 年前

5 条评论

chrisseldo大约 7 年前
&quot;I&#x27;m in awe of your truly marvelously disgusting hack. That is truly a work of art.&quot;<p>Ha. How should one take such a comment?
评论 #16702380 未加载
评论 #16702971 未加载
评论 #16703357 未加载
评论 #16702508 未加载
评论 #16702719 未加载
评论 #16702381 未加载
marshray大约 7 年前
Go on, tell me again about how C++ compile-time metaprogramming is so horrible ...
评论 #16705509 未加载
评论 #16705131 未加载
djhaskin987大约 7 年前
The reply of the guy Linus is addressing is worth a read: <a href="https:&#x2F;&#x2F;lkml.org&#x2F;lkml&#x2F;2018&#x2F;3&#x2F;20&#x2F;871" rel="nofollow">https:&#x2F;&#x2F;lkml.org&#x2F;lkml&#x2F;2018&#x2F;3&#x2F;20&#x2F;871</a>
ksherlock大约 7 年前
I didn&#x27;t believe it would work but it does. It boils down to<p><pre><code> sizeof(int) == sizeof(void) </code></pre> vs<p><pre><code> sizeof(int) == sizeof(int) </code></pre> As a non-standard extension, in gcc (and thus clang and icc for compatibility, it seems) void has a size of 1. In a conforming compiler, it&#x27;s an error.
评论 #16706090 未加载
kuon大约 7 年前
I&#x27;ve been writing C for 20 years and I have no idea what I am reading.
评论 #16704199 未加载