From owner-cvs-all@FreeBSD.ORG Wed Jul 9 15:46:56 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 495261065671; Wed, 9 Jul 2008 15:46:56 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 0891E8FC13; Wed, 9 Jul 2008 15:46:55 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.2/8.14.2) with ESMTP id m69FnjVo047903; Wed, 9 Jul 2008 11:49:45 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.2/8.14.2/Submit) id m69FnjjD047902; Wed, 9 Jul 2008 11:49:45 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 9 Jul 2008 11:49:45 -0400 From: David Schultz To: Daniel Gerzo Message-ID: <20080709154945.GA47824@zim.MIT.EDU> Mail-Followup-To: Daniel Gerzo , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200807091404.m69E4jiC075715@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200807091404.m69E4jiC075715@repoman.freebsd.org> Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/share/man/man9 style.9 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2008 15:46:56 -0000 On Wed, Jul 09, 2008, Daniel Gerzo wrote: > -Do not declare functions inside other functions; ANSI C says that > -such declarations have file scope regardless of the nesting of the > -declaration. > -Hiding file declarations in what appears to be a local > -scope is undesirable and will elicit complaints from a good compiler. > +Do not declare functions inside other functions; nested functions are > +a GCC extension and are not permitted by ANSI C. We use lots of extensions that aren't strict ANSI C. I think the real reason not to use them is that gcc's nested functions are particularly unwieldily. First, they're not true lexical closures (and can't be), which makes them much less useful. Second, they are unsupported unless a number of assumptions are met, e.g., must have an executable stack, must be able to invalidate the I cache from userland, and must not have separate I and D address spaces. Nested functions abominable enough that Apple disabled the feature in OS X's build of gcc --- and the Sun and Intel compilers don't support them, even though Intel claims nearly complete gcc compatibility.