# C99

**C99**是ISO/IEC 9899:1999的非正式名称，即C编程语言标准的修订版，由ISO于1999年12月1日发布，作为C90的后续版本。<sup>[1](https://open-std.org/jtc1/sc22/wg14/www/standards)</sup> 在制定过程中，该版本的草案被称为C9X。<sup>[2](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)</sup> 它新增了大量语言与库特性，包括变长数组、`restrict`关键字、复数运算、指定初始化器和复合字面量，并且在后续修订版出现很久之后，它仍然是大量C代码的基准。<sup>[3](https://en.cppreference.com/w/c/99)</sup>

| 关键事实 | 详情 |
|---|---|
| 正式身份 | ISO/IEC 9899:1999，1999-12-01发布；称为C99<sup>[1](https://open-std.org/jtc1/sc22/wg14/www/standards)</sup> |
| 制定期名称 | 草案被称为C9X<sup>[2](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)</sup> |
| 勘误 | 三份技术勘误，分别于2001年、2004年和2007年发布；整合后的公开版本为WG14 N1256，日期为2007-09-07<sup>[1](https://open-std.org/jtc1/sc22/wg14/www/standards)</sup> |
| 标志性语言特性 | 变长数组、`restrict`指针、柔性数组成员、`_Bool`、`_Complex`、`inline`、可变参数宏、复合字面量、指定初始化器、声明与代码混合<sup>[3](https://en.cppreference.com/w/c/99)</sup> |
| 独立式库新增 | 自C99起，独立式实现也必须提供`<stdbool.h>`和`<stdint.h>`<sup>[2](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)</sup> |
| GCC支持 | 截至GCC 4.5，配合`-std=c99 -pedantic-errors`已基本完整<sup>[4](https://gcc.sourceware.org/projects/c-status.html)</sup> |
| 后续版本 | C11（2011）、C17（2018）和C23（ISO/IEC 9899:2024，2024年通过）<sup>[5](https://open-std.org/jtc1/sc22/wg14/)</sup> |

## 起源与修订目标

修订工作始于ISO/IEC JTC1/SC22/WG14，即C语言的国际标准化工作组。1993年12月，在夏威夷科纳（Kona, Hawaii）举行的WG14/X3J11会议上，各方普遍同意委员会应开始考虑C标准的下一个版本，随后制定了一份修订章程。<sup>[6](https://open-std.org/jtc1/sc22/wg14/www/docs/historic/n444.htm)</sup>

章程为这次修订定下了基调。它指示委员会尽量减少与C90（ISO/IEC 9899:1990）的不兼容，避免“静默变更”——即未经提示就改变现有代码含义的改动——并保持C的精神，包括作为“高级汇编器”编写机器相关代码的能力。<sup>[6](https://open-std.org/jtc1/sc22/wg14/www/docs/historic/n444.htm)</sup> C9X理由书（C9X Rationale）是委员会的解释性文件，其中声明语言仅由标准定义，理由书不属于标准的一部分。<sup>[7](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n850.pdf)</sup>

## 新增语言特性

C99的新增内容可分为几组。<sup>[3](https://en.cppreference.com/w/c/99)</sup>

**数值与类型特性。** 标准新增了布尔类型`_Bool`（配合`<stdbool.h>`），通过`_Complex`关键字支持复数，可选`_Imaginary`类型，`<stdint.h>`中的定宽整数类型，十六进制浮点常量，以及浮点环境。它还要求对有符号整数类型的除法进行截断。<sup>[3](https://en.cppreference.com/w/c/99)</sup><sup> • </sup><sup>[8](https://www.intel.com/content/www/us/en/developer/articles/technical/c99-support-in-intel-c-compiler.html)</sup>

**数组与对象。** 变长数组（VLA）类型和可变修改类型允许自动数组以非常量表达式的长度声明。据该特性的提案文件所述，此前将C用于数值计算的一个常被提及的主要障碍，就是数组无法以仅在程序运行时才能确定的大小来声明。<sup>[9](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n937.pdf)</sup> C99还新增了柔性数组成员，允许结构体以未指定大小的数组结尾。<sup>[3](https://en.cppreference.com/w/c/99)</sup>

**语法与便利性。** 声明和语句可以混合排列，`for`循环增加了初始化语句，`main()`增加了隐式的`return 0;`，并引入了预定义变量`__func__`。指定初始化器让程序员可以按索引或字段名以任意顺序给出数组元素或结构体字段，复合字面量则直接在表达式中创建无名对象。可变参数宏、`_Pragma`运算符、`//`注释以及枚举列表中的尾随逗号补全了这些变化。<sup>[3](https://en.cppreference.com/w/c/99)</sup><sup> • </sup><sup>[10](https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Designated-Inits.html)</sup>

**函数与指针。** 新增了`inline`函数说明符和`restrict`指针限定符——后者断言指针是在某一作用域内访问其指向对象的唯一途径——以及数组参数声明中的限定符和`static`。<sup>[3](https://en.cppreference.com/w/c/99)</sup>

## 标准化历史与勘误

该标准于1999年12月1日发布。错误在三份技术勘误中得到更正：Cor. 1:2001、Cor. 2:2004和Cor. 3:2007，最后一份可从ISO免费获取。C99标准最新的公开可用版本是C99 + 技术勘误1 + 技术勘误2 + 技术勘误3的合并文档，即WG14 N1256，日期为2007-09-07，这是一份反映整合后标准的WG14工作文件。<sup>[1](https://open-std.org/jtc1/sc22/wg14/www/standards)</sup> WG14还维护着一份针对ISO/IEC 9899:1999的变更与澄清请求日志，此前称为缺陷报告（Defect Reports）。<sup>[11](https://open-std.org/jtc1/sc22/wg14/www/projects.html)</sup>

## 编译器支持

截至GCC 4.5，GCC对C99的支持已基本完整，使用时配合`-std=c99 -pedantic-errors`（GCC 5之前对扩展标识符还需`-fextended-identifiers`），但仍存在缺陷和浮点问题，主要涉及可选的附录F和G特性；在需要库配合的地方，假定使用较新的GNU C库。<sup>[4](https://gcc.sourceware.org/projects/c-status.html)</sup> GCC通过`-std=c99`或`-std=iso9899:1999`选择该标准，通过`-std=gnu99`选择带GNU扩展的扩展方言。<sup>[2](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)</sup> 部分C99特性在C90模式下也作为扩展被接受。<sup>[2](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)</sup>

其他编译器的支持情况各不相同。Clang支持变长数组、柔性数组成员、`inline`函数和可变参数宏，但对`_Complex`仅部分支持，即不支持`_Imaginary`类型说明符；对`_Imaginary`的支持在C99中是可选的，Clang也不声称符合附录G。<sup>[12](https://clang.llvm.org/c_status.html)</sup> Intel C++编译器12.0及更新版本支持主要的C99特性，在Linux和macOS上通过`-std=c99`选择，在Windows上通过`/Qstd=c99`选择，默认仍为C89。<sup>[8](https://www.intel.com/content/www/us/en/developer/articles/technical/c99-support-in-intel-c-compiler.html)</sup> cppreference的支持表显示，例如浮点求值的标准编译指示在GCC和Clang中均不受支持，而浮点环境支持在两者中都是部分的。<sup>[13](https://en.cppreference.com/c/compiler_support/99)</sup>

测试实践也跟随标准的覆盖范围。一项针对Palm OS Cobalt的C99交叉编译器的研究使用与参考工具的输出比对，发现了数百个缺陷，其中GNU C编译器中有十八个，ARM处理器版本的GCC中有十二个，其中若干是严重缺陷。<sup>[14](https://arxiv.org/abs/2202.07390)</sup>

## 在标准历史中的位置

C99之后是C11（ISO/IEC 9899:2011，2011-12-08发布）、C17（ISO/IEC 9899:2018）和C23（ISO/IEC 9899:2024，由ISO和IEC于2024年通过），另有进一步修订版C2y正在制定中。<sup>[1](https://open-std.org/jtc1/sc22/wg14/www/standards)</sup><sup> • </sup><sup>[5](https://open-std.org/jtc1/sc22/wg14/)</sup> 部分C99特性并未作为强制要求延续下来：尤其是变长数组，在一些主流编译器中仅被列为部分支持，而C99的特性测试宏（如用于IEEE-754算术的`__STDC_IEC_559__`）标记的是可选能力，实现可以提供也可以不提供。<sup>[3](https://en.cppreference.com/w/c/99)</sup><sup> • </sup><sup>[13](https://en.cppreference.com/c/compiler_support/99)</sup>

尽管如此，C99仍成为实际上的基准。GNU编码标准指出，ISO C99已足够普及，在程序中使用其特性是可以接受的，同时建议在必须支持GCC以外的编译器时有条件地使用。<sup>[15](https://www.gnu.org/prep/standards/html_node/Standard-C.html)</sup> C99的理由书仍可从WG14获取。<sup>[5](https://open-std.org/jtc1/sc22/wg14/)</sup>

## References

1. [ISO/IEC JTC1/SC22/WG14 - C: Approved standards](https://open-std.org/jtc1/sc22/wg14/www/standards)
2. [Standards, Using the GNU Compiler Collection (GCC)](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)
3. [C99 - cppreference.com](https://en.cppreference.com/w/c/99)
4. [C Standards Support in GCC - GNU Project](https://gcc.sourceware.org/projects/c-status.html)
5. [ISO/IEC JTC1/SC22/WG14 - C](https://open-std.org/jtc1/sc22/wg14/)
6. [WG 14 N 444 - The C9X Charter as revised at the June 1995 meeting in Copenhagen](https://open-std.org/jtc1/sc22/wg14/www/docs/historic/n444.htm)
7. [C9X Rationale, WG14/N850 J11/98-049](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n850.pdf)
8. [C99 Support in Intel C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c99-support-in-intel-c-compiler.html)
9. [c99ratio.PDF, WG14 N937](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n937.pdf)
10. [Designated Inits, Using the GNU Compiler Collection (GCC)](https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Designated-Inits.html)
11. [Project status and milestones, WG14](https://open-std.org/jtc1/sc22/wg14/www/projects.html)
12. [Clang - C Programming Language Status](https://clang.llvm.org/c_status.html)
13. [Compiler support for C99 - cppreference.com](https://en.cppreference.com/c/compiler_support/99)
14. [Practical Testing of a C99 Compiler Using Output Comparison, arXiv](https://arxiv.org/abs/2202.07390)
15. [Standard C, GNU Coding Standards](https://www.gnu.org/prep/standards/html_node/Standard-C.html)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Programming languages › Individual programming languages › C-family and imperative languages

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/c99

English original: https://www.edgepedia.org/c99
