A/UX cc 编译器在简单代码上出现错误:“声明的参数 argc 丢失”
在使用内置 c 编译器 (cc) 的相当古老的 UNIX(用于 680x0 处理器的 Apple A/UX 3.0.1)上,会出现此问题。
这是我试图编译的代码:
#include <stdlib.h>
#include <stdio.h>
int main()
int argc;
char **argv;
{
if (argc > 1)
puts(argv[1]);
return (EXIT_SUCCESS);
}
这是我得到的输出:
pigeonz.root # cc -c test.c
"test.c", line 5: declared argument argc is missing
"test.c", line 6: declared argument argv is missing
使用更现代的原型没有帮助,手册页也没有帮助,快速谷歌搜索也没有帮助。我做错了什么?
On a quite ancient UNIX (Apple A/UX 3.0.1 for 680x0 processors) using the built-in c compiler (cc), this issue arrises.
Here is the code I'm trying to compile:
#include <stdlib.h>
#include <stdio.h>
int main()
int argc;
char **argv;
{
if (argc > 1)
puts(argv[1]);
return (EXIT_SUCCESS);
}
And here is the output I get:
pigeonz.root # cc -c test.c
"test.c", line 5: declared argument argc is missing
"test.c", line 6: declared argument argv is missing
Using a more modern prototype did not help, nor did the manual page, nor a quick google search. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于old skool,K&RCI 认为它需要是:
For old skool K&R C I think it needs to be:
这是来自 Lint 的错误(代码 53)。您可以在此处查看引发该错误的源代码:
http://www.opensource.apple.com/source/developer_cmds/developer_cmds-49/lint/lint1/decl.c
您可以尝试查看该代码,看看是否可以找出导致的结果该特定的代码路径。
That's an error from Lint (code 53). You can see the source code that throws that error here:
http://www.opensource.apple.com/source/developer_cmds/developer_cmds-49/lint/lint1/decl.c
You could try looking at that code and see if you can work out what leads to that particular code path.