From owner-freebsd-current@FreeBSD.ORG Thu May 26 04:48:22 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BE7416A41C for ; Thu, 26 May 2005 04:48:22 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id D96F443D48 for ; Thu, 26 May 2005 04:48:21 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from dibbler.crodrigues.org (c-66-30-114-143.hsd1.ma.comcast.net[66.30.114.143]) by comcast.net (rwcrmhc11) with ESMTP id <2005052604481701300ekjrue>; Thu, 26 May 2005 04:48:21 +0000 Received: from c-66-30-114-143.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by dibbler.crodrigues.org (8.13.3/8.13.1) with ESMTP id j4Q4mPGs081421; Thu, 26 May 2005 00:48:25 -0400 (EDT) (envelope-from rodrigc@c-66-30-114-143.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.3/8.13.1/Submit) id j4Q4mOAD081420; Thu, 26 May 2005 00:48:24 -0400 (EDT) (envelope-from rodrigc) Date: Thu, 26 May 2005 00:48:24 -0400 From: Craig Rodrigues To: "Andrew R. Reiter" Message-ID: <20050526044824.GA81201@crodrigues.org> References: <20050526020143.GA80396@crodrigues.org> <20050525234400.H5498@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050525234400.H5498@fledge.watson.org> User-Agent: Mutt/1.5.9i Cc: freebsd-current@freebsd.org Subject: Re: [GCC 4.0 PATCH] devfs_vnops.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2005 04:48:22 -0000 On Wed, May 25, 2005 at 11:44:52PM -0400, Andrew R. Reiter wrote: > Is this a GCC-ism or a standards related issue that 4.0 now addresses? This is a standards issue that GCC 4.0 addresses, which GCC 3.4.2 did not (newer versions of the GCC 3.4.x tree might address is but I haven't checked). In 6.2.2 paragraph 7 of the ISO C standard, "If, within a translation unit, the same identifier appears with both internal and external linkage, the behavior is undefined." So, if you have: extern struct foo bar; static struct foo bar = { ..... }; This is illegal. When the compiler hits the first line, there was no previous declaration of "struct foo bar", so the linkage of "struct foo bar" defaults to external linkage. However, the next line declares "struct foo bar" to have internal linkage. -- Craig Rodrigues rodrigc@crodrigues.org