Dependable C

Lobsters Hottest 工具

摘要

一个全面的资源,提供编写可靠、安全的C代码的指南和建议,涵盖未定义行为、内存模型以及特定版本的注意事项。

<p><a href="https://lobste.rs/s/plztql/dependable_c">评论</a></p>
查看原文
查看缓存全文

缓存时间: 2026/07/20 09:34

# 可靠的 C 语言 来源:https://dependablec.org/ 显式编程 菜单按钮 #### 引言 - [实现支持](https://dependablec.org/#ImplementationSuport) - [C 语言版本](https://dependablec.org/#C%20version) - [为何不修复 C](https://dependablec.org/#Why%20not%20fix%20C) #### 要求 - [要求](https://dependablec.org/#Requirements) #### 通用建议 - [警告](https://dependablec.org/#Warnings) - [C++ 兼容性](https://dependablec.org/#C++%20compatibility) - [标准库](https://dependablec.org/#Standard%20library) #### C 语言概念 - [如同规则](https://dependablec.org/#As-If) - [未定义行为](https://dependablec.org/#undefined%20behavior) #### 关键字 - [流程控制](https://dependablec.org/#flow%20control) - [关键字列表](https://dependablec.org/#keyword%20list) - [保留关键字](https://dependablec.org/#reserved%20keywords) #### 类型 - [字节序](https://dependablec.org/#Endianess) - [浮点数](https://dependablec.org/#floats) - [C 语言中的初始化](https://dependablec.org/#Initialization%20in%20C) - [类型大小](https://dependablec.org/#Types%20Sizes) - [布尔类型](https://dependablec.org/#%20Bool) #### 运算符 - [比较](https://dependablec.org/#Comparasions) - [移位](https://dependablec.org/#shifts) #### C 语言版本 - [C99](https://dependablec.org/#C99) - [C11](https://dependablec.org/#C11) - [C17](https://dependablec.org/#C17) - [C23](https://dependablec.org/#C23) #### 内存模型 - [变长数组(VLA)存在问题](https://dependablec.org/#VLAs%20are%20broken) - [并发](https://dependablec.org/#Concurrency) - [C 语言中的有效类型](https://dependablec.org/#Effective%20type%20in%20c) - [柔性数组成员](https://dependablec.org/#Flexible%20array%20member) - [建议](https://dependablec.org/#recomendations) #### 可靠的未定义行为 - [可靠的未定义行为](https://dependablec.org/#Dependable%20UB) #### 额外内容 - [内存调试器](https://dependablec.org/#Memory%20debugger) - [推文](https://dependablec.org/#tweets) - [为什么 C 是最安全的语言](https://dependablec.org/#Why%20is%20C%20the%20safest%20language) #### 关于 - [关于](https://dependablec.org/#About)

相似文章

C语言中的一切皆为未定义行为

Hacker News Top

一位经验丰富的C++开发者认为,所有非平凡的C和C++代码都包含未定义行为,使得内存安全无法实现,并质疑这些语言在现代软件开发中的持续使用。

减少 C 语言中的未定义行为

Hacker News Top

Martin Uecker 在 Kernel Recipes 2026 上发表了关于 C 语言中未定义行为的演讲,探讨了其产生的原因、抽象机器模型如何为其提供依据,以及 C 语言最终能否变得内存安全。

关于C扩展、可移植性和替代编译器

Lobsters Hottest

本文讨论了编写可移植C代码的实际挑战,这些挑战源于对非标准编译器扩展和glibc条件头文件的依赖,并通过构建C编译器的示例进行说明。

写给 Rust 程序员的 C 语言

Lobsters Hottest

一篇由 Rust 程序员撰写的博文,记录了其自学 C 语言过程中遇到的各种奇特行为,包括通过 <stdbool.h> 实现布尔类型、以 null 结尾的字符串与 Rust 中长度前缀的 &str 之间的对比,以及相关的内存权衡。对于从 Rust 转向 C 的开发者来说,它是一份实用的配套指南。