Hi,
Well, since everyone on this list has been so helpful
to me in helping me get Ethereal to work under AIX,
I was wondering if someone could help.
With the AIX C compiler, if I have the following program, a.c:
int foo(int a, int b, int c){ return 0; }
int main(int argc, char **argv){
foo(5, 3);
return 0;
}
If I compile this program, the compiler generates a non-fatal
warning:
"a.c", line 7.5: 1506-098 (E) Missing argument(s).
Since this error is non-fatal, the return code from the compiler is 0,
and an a.out binary is generated. I consider this a bug, because
every other C compiler I've used (Sun, gcc) don't let this pass.
When I phoned IBM though, their support droid told me that this behavior
follows the ANSI standard spec for non-prototyped functions in C.
This sounds like hogwash to me, because the function I gave is fully
prototyped and defined. I don't have a copy of the ANSI standard spec
on me, so I couldn't argue with the guy.
Does someone out there have access to the ANSI C spec? Could you
tell me what the correct behavior is if you pass an incorrect number
of arguments to a C function (a regular function, not a varargs one).
AIX is beginning to piss me off, so if this is IBM's bug, I want them to
fix it. :)
P.S. Sorry for the non-ethereal, non-networked, AIX-specific post. :)
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@xxxxxxxxxxxx
Powered by MHonArc 2.6.10