【发布时间】:2011-01-17 06:33:13
【问题描述】:
如果我使用 c89 和 c99 编译以下程序有区别吗?我得到相同的输出。两者真的有区别吗?
#include <stdio.h>
int main ()
{
// Print string to screen.
printf ("Hello World\n");
}
gcc -o helloworld -std=c99 helloworld.c
vs
gcc -o helloworld -std=c89 helloworld.c
【问题讨论】:
-
"gcc -std=c89" 和 "gcc -std=c99" 不完全符合各自的标准。添加“-pedantic”或“-pedantic-errors”以获得接近完全一致性的内容。
标签: c gcc compiler-construction c99 c89