you're mixing ANSI prototypes and the original style, and
in
void f(b)
char b;
i suspect b is promoted to int, because before prototypes C compilers
didn't know an argument was a char at point of call, and chars were promoted to
int (similarly float to double),
and the function with the argument so promoted clashes with the earlier void
f(char).
in any case, if you're going to use 8c at all, just commit to ANSI prototypes.
in fact, even if you're not going to use 8c, just use ANSI prototypes and
either way,
avoid or eliminate the ARGS crud.
surely it must be at least 20 years old.
if the code is imported i suppose it doesn't matter, but if it's new code,
using ARGS or __PROTO or whatever is usually just silly.
--- Begin Message ---
Hi all,
Is this a feature or bug of 8c? Look at this:
term% cat t.c
#include <u.h>
#include <libc.h>
#define ARGS(list) list
void foo ARGS((char));
void foo1 ARGS((int));
void main(void)
{
foo('s');
foo1(1);
exits(nil);
}
void foo (b)
char b;
{
}
void foo1 (b)
int b;
{
}
term% 8c -FVw t.c
t.c:17 function inconsistently declared: foo
warning: t.c:17 param declared and not used: b
warning: t.c:22 param declared and not used: b
My question is: Why I get the "function inconsistently declared" error?
or Why I'm not get the same error about foo1?
Lee
--- End Message ---