From owner-freebsd-questions@FreeBSD.ORG Mon Nov 28 07:09:12 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 44D9E16A41F for ; Mon, 28 Nov 2005 07:09:12 +0000 (GMT) (envelope-from mamta.bansal@st.com) Received: from lon-del-04.spheriq.net (lon-del-04.spheriq.net [195.46.50.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D29A43D6D for ; Mon, 28 Nov 2005 07:09:10 +0000 (GMT) (envelope-from mamta.bansal@st.com) Received: from lon-out-01.spheriq.net ([195.46.50.129]) by lon-del-04.spheriq.net with ESMTP id jAS799rt026659 for ; Mon, 28 Nov 2005 07:09:09 GMT Received: from lon-cus-02.spheriq.net (lon-cus-02.spheriq.net [195.46.50.38]) by lon-out-01.spheriq.net with ESMTP id jAS798up000444 for ; Mon, 28 Nov 2005 07:09:08 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-02.spheriq.net with ESMTP id jAS797iD020845 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Mon, 28 Nov 2005 07:09:07 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B01A5DA44 for ; Mon, 28 Nov 2005 07:09:06 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 79AAC47240; Mon, 28 Nov 2005 07:12:10 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3FB9475994 for ; Mon, 28 Nov 2005 07:12:10 +0000 (UTC) Received: from mail2.dlh.st.com (mail2.dlh.st.com [138.198.194.103]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 883B847239 for ; Mon, 28 Nov 2005 07:12:09 +0000 (GMT) Received: from st.com (dlhs0002.dlh.st.com [10.180.2.11]) by mail2.dlh.st.com (MOS 3.5.8-GR) with ESMTP id BYL22969 (AUTH "mamta bansal"); Mon, 28 Nov 2005 12:39:03 +0530 (IST) Message-ID: <438AAD0F.90205@st.com> Date: Mon, 28 Nov 2005 12:39:03 +0530 From: Mamta BANSAL User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.2.0 Subject: questions about gcc options X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2005 07:09:12 -0000 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