From owner-cvs-src@FreeBSD.ORG Thu Jan 18 08:59:58 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 544F716A40F; Thu, 18 Jan 2007 08:59:58 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep15-int.chello.at (viefep13-int.chello.at [213.46.255.15]) by mx1.freebsd.org (Postfix) with ESMTP id 7912B13C44B; Thu, 18 Jan 2007 08:59:55 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from lizard.fafoe.narf.at ([213.47.85.26]) by viefep18-int.chello.at (InterMail vM.6.01.05.04 201-2131-123-105-20051025) with ESMTP id <20070118084158.WRSB2293.viefep18-int.chello.at@lizard.fafoe.narf.at>; Thu, 18 Jan 2007 09:41:58 +0100 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id E5A8DBB8D; Thu, 18 Jan 2007 09:41:57 +0100 (CET) Date: Thu, 18 Jan 2007 09:41:57 +0100 From: Stefan Farfeleder To: Craig Rodrigues Message-ID: <20070118084157.GA920@lizard.fafoe.narf.at> References: <200701180200.l0I2049r024678@repoman.freebsd.org> <20070117214345.27d1db56@kan.dnsalias.net> <20070118052816.GA3582@crodrigues.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070118052816.GA3582@crodrigues.org> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Alexander Kabaev , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/amd64/include md_var.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2007 08:59:58 -0000 On Thu, Jan 18, 2007 at 12:28:16AM -0500, Craig Rodrigues wrote: > On Wed, Jan 17, 2007 at 09:43:45PM -0500, Alexander Kabaev wrote: > > Back this out please. I do not see how this change can possibly be > > correct. > > For this testcase: > void main(void) > { > extern struct foo array_foo[]; > return 0; > } > > GCC3 will compile this testcase without error, but GCC4 > will complain with: error: "array type has incomplete element type". > > Two ways to eliminate this GCC4 compilation error: > (1) Change testcase to: > int main(void) > { > extern struct foo *array_foo; > return 0; > } This is wrong, arrays and pointers are different beasts. > (2) Make struct definition visible earlier on: > > #include "foo.h" /* where foo.h contains: struct foo { int a; }; */ > > int main(void) > { > extern struct foo array_foo[]; > return 0; > } > > > For md_var.h, I chose approach (1). Do recommend approach (2), > or some other fix? Either make the struct complete or remove the declaration entirely (I guess that's not possible here). Stefan