Re: Doubt
- From: Anarki <Deepchand.P@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 03:54:15 -0700 (PDT)
On Jul 31, 3:44 pm, Ian Collins <ian-n...@xxxxxxxxxxx> wrote:
Anarki wrote:
int main(a,b,c,d,e,f,g)
{
printf("Size of a = %d\nSize of b =%d",sizeof(a),sizeof(b));
return 0;
}
The above program perfectly compiles in cygwin using gcc
and my questions are
1.How does the compiler know what are the types of variables a, b, c,
d, e, f and g?? Where is its declaration?
It's assuming they are int.
2.I haven't included stdio.h yet the printf compiles.The compiler
doesn't complain about the requirement of function prototype, why?
It does.
gcc /tmp/x.c
/tmp/x.c: In function 'main':
/tmp/x.c:3: warning: incompatible implicit declaration of built-in
function 'printf'
--
Ian Collins.
y no warning for me! ok if at all it complains how does this program
link with the printf? Does it look in default include files/libs ??
By the way I use Cygwin(windows Xp) is there a way to redirect the
warning/errors to a text file. If so please tell me how
.
- Follow-Ups:
- Re: Doubt
- From: santosh
- Re: Doubt
- Prev by Date: Re: Doubt
- Next by Date: Re: Doubt
- Previous by thread: Re: Doubt
- Next by thread: Re: Doubt
- Index(es):
Relevant Pages
|