Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Nov 2005 12:39:03 +0530
From:      Mamta BANSAL <mamta.bansal@st.com>
To:        freebsd-questions@freebsd.org
Subject:   questions about gcc options
Message-ID:  <438AAD0F.90205@st.com>

next in thread | raw e-mail | index | archive | help
Hello
         for a c code i am using gcc compiler.
i have doubt using -c option.
for a c code the code compiles (without error ) with -c option even if i 
don't provide prior declaration of function.
i mean i have try.c
//*******************

void my_func( ){
call_to_undeclared_func( );
}
//********************
i do : gcc -c try.c , it works.
is it the correct behaviour , i mean should it not ask for atleast 
declearation of call_to_undeclared_func( );

like if my make the same as try.cpp then usen use the same command it 
gives the foll. error.:

try.cpp: In function `void my_func()':
try.cpp:2: implicit declaration of function `int 
 call_to_undeclared_func(...)'
which i feel is expected behaviour.

Best Regards
Mamta





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?438AAD0F.90205>