Question

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?

Was it helpful?

Solution

For old skool K&R C I think it needs to be:

#include <stdlib.h>
#include <stdio.h>

int main(argc, argv)
int argc;
char **argv;
{
    if (argc > 1)
        puts(argv[1]);
    return (EXIT_SUCCESS);
}

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top