Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2007 00:28:16 -0500
From:      Craig Rodrigues <rodrigc@crodrigues.org>
To:        Alexander Kabaev <kabaev@gmail.com>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/amd64/include md_var.h
Message-ID:  <20070118052816.GA3582@crodrigues.org>
In-Reply-To: <20070117214345.27d1db56@kan.dnsalias.net>
References:  <200701180200.l0I2049r024678@repoman.freebsd.org> <20070117214345.27d1db56@kan.dnsalias.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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;
}

(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?

-- 
Craig Rodrigues        
rodrigc@crodrigues.org



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