A/UX cc compiler errors on trivial code: "declared argument argc is missing"

Posted by Fzn on Stack Overflow See other posts from Stack Overflow or by Fzn
Published on 2010-05-05T09:10:26Z Indexed on 2010/05/05 9:28 UTC
Read the original article Hit count: 416

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?

© Stack Overflow or respective owner

Related posts about c

    Related posts about argument