Undeclared function arguments
Rick 'Transputer' Stein
Rick'Transputer'Stein at dhw68k.cts.com
Fri Oct 14 03:48:31 AEST 1988
I wonder if any of you gurus can comment on the following fragment of
code output from lex:
The function yyback has two arguments, but only one is typed in argument
the list. Why does my C compiler or lint, for that matter, not complain?
yyback(p,m)
int *p;
{
if (p==0)return(0);
while(*p)
{
if ( *p++ == 0 )return(1);
}
return(0);
}
I've compiled this fragment along with the body of lex.yy.c on many
machines and compilers (SGI/4D, HP9000, SUN/4, Inmos transputers with
3L,MSC 4.0, etc) and no errors have been generated. Are undeclared
function arguments auto casted to pointers?
Thanks in advance.
+--------------------------+---------------------------------------+
| Rick 'Transputer' Stein | uucp: ...{felix, zardoz}!dhw68k!stein |
| "Goddam digital confuser | MaBellnet: 714-786-7794 (H) |
| technology..." | 714-540-8900 (W) |
| Disclaimer: These opinions are mine, not my employer's. |
+--------------------------+-------------------------------------- +
More information about the Comp.lang.c
mailing list