Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下代码的查询。以下代码如何根据 K&R c 进行解释?没有编译错误,代码运行良好。我在代码块的构建选项中使用了-traditional。搜索了一会,但没有得到满意的答案。
void func(int); int main(void) { func(10); return 0; } void func(void){ }
以下代码如何根据 K&R C 进行解释?
作为具有语法错误的代码。K&R C 既不知道原型也不知道void关键字(两者都是在 C89 中引入的),所以这是一个语法错误。
void
从 C89 开始,冲突声明是必须诊断的约束违规(错误的花哨词)。