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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

C has its limits. If you know where to look

16 点作者 jandeboevrie5 个月前

3 条评论

eqvinox5 个月前
This should be updated for ISO C23&#x27;s _BitInt(N), which is <i>not</i> equivalent to intN_t (the type promotion rules differ!)<p>(It also supports &quot;uncommon&quot; values of N)
pajko5 个月前
Never use fixed-size integers unless you are communicating with hardware, implementing some protocol or manipulating binary files.<p>If some code shared between 8&#x2F;16-bit and 32&#x2F;64-bit architectures requires an a least 16-bit type, go for &quot;int&quot;. If it requires an at least 32-bit type, go for &quot;long&quot;.<p>Also fixed-size integers shall not be printed with standard directives like %d or %u, but the PRId32, PRIu32, PRIx32, etc... macros shall be used from inttypes.h.
评论 #42409639 未加载
gregw25 个月前
FYI, there was a semi-related discussion on architectures and bit widths on HN a couple months ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41773559">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41773559</a>