XC16 v1.5默认使用什么C标准?

What C standard does XC16 v1.5 use by default?

对于 Microchip 的 XC16 v1.5 编译器默认使用什么 C 标准(xc16-gcc -> 选项 = 空),我找不到明确的答案。

如果我们将它指定为 -std=C99,我们显然会得到不同的结果,但是从什么来的?!?

xc16编译器使用C89标准。 看看 manual.

中的第 7 章

This compiler conforms to the ANSI X3.159-1989 Standard for programming languages. This is commonly called the C89 Standard. It is referred to as the ANSI C Standard in this manual. Some features from the later standard C99 are also supported.

选择 XC8 2.0 及更高版本的编译器后,您可以启用 C99 标准。