From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20894 invoked by alias); 12 Dec 2002 13:58:28 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 20887 invoked from network); 12 Dec 2002 13:58:27 -0000 Received: from unknown (HELO fencepost.gnu.org) (199.232.76.164) by sources.redhat.com with SMTP; 12 Dec 2002 13:58:27 -0000 Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.10) id 18MTr9-0004wJ-00 for gcc@gnu.org; Thu, 12 Dec 2002 08:58:27 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18MTr6-0000cw-00 for gcc@gnu.org; Thu, 12 Dec 2002 08:58:25 -0500 Received: from qnxmail.qnx.com ([209.226.137.76] helo=hub.ott.qnx.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18MTr6-0000ch-00 for gcc@gnu.org; Thu, 12 Dec 2002 08:58:24 -0500 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id IAA05817; Thu, 12 Dec 2002 08:52:38 -0500 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id IAA08955; Thu, 12 Dec 2002 08:49:55 -0500 Message-ID: <06a001c2a1e6$782b2a40$0202040a@catdog> From: "Kris Warkentin" To: , "Timothy J. Wood" Cc: "GCC List" References: Subject: Re: We are nesting functions now? Date: Thu, 12 Dec 2002 06:49:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Status: No, hits=-4.7 required=5.0 tests=INVALID_MSGID,QUOTED_EMAIL_TEXT,REFERENCES, SPAM_PHRASE_00_01,USER_AGENT_OE version=2.41 X-Spam-Level: X-SW-Source: 2002-12/txt/msg00638.txt.bz2 It's a gcc extension. Probably in there for Pascal support. http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Nested-Functions.html#Nested%20Fun ctions cheers, Kris ----- Original Message ----- From: "Timothy J. Wood" To: Cc: "GCC List" Sent: Thursday, December 12, 2002 1:00 AM Subject: Re: We are nesting functions now? > > > If you move the call to f3 so that it is in the proper scope, this > works: > > % cc -Wall foo.c -o foo > % ./foo > F1 > F3 > F2 > % cc -v > cc -v > Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs > Thread model: posix > Apple Computer, Inc. GCC version 1173, based on gcc version 3.1 > 20020420 (prerelease) > > > #include > int main() { > void fi() { > void f2() { > printf("F2\n"); > } > void f3() { > printf("F3\n"); > f2(); > } > printf("F1\n"); > f3(); > } > fi(); > return 1; > } > > -tim > >