From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15357 invoked by alias); 29 May 2009 09:04:29 -0000 Received: (qmail 15348 invoked by uid 22791); 29 May 2009 09:04:28 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 May 2009 09:04:21 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4T92JVW008792; Fri, 29 May 2009 05:02:19 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4T92HjW008651; Fri, 29 May 2009 05:02:17 -0400 Received: from zebedee.pink (vpn-12-138.rdu.redhat.com [10.11.12.138]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4T92FJA023317; Fri, 29 May 2009 05:02:16 -0400 Message-ID: <4A1FA497.2000302@redhat.com> Date: Fri, 29 May 2009 10:17:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: "Joseph S. Myers" CC: Dave Korn , "gcc@gcc.gnu.org" Subject: Re: What does zero-length array mean at file scope? References: <4A189BCD.1090707@gmail.com> <4A18A2C8.2020204@gmail.com> <4A18B11A.6080505@gmail.com> <4A1912AC.6080505@redhat.com> <4A191A80.9010001@gmail.com> <4A1922B0.9090209@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg00677.txt.bz2 Joseph S. Myers wrote: > On Sun, 24 May 2009, Andrew Haley wrote: > >> Of course we have to fix the assembler output. For [any] two declarations >> a and b, &a != &b, even when a is a zero-length array. So, you have to >> allocate at least one byte. > > I don't think this is necessarily part of the semantics for the GNU > extensions of zero-length arrays and empty structures. Certainly when > they are used in the middle of a structure they are not expected to take > up any space (so their address may be the same as that of the next > member). I see. In that this breaks the semantics of C in a pretty fundamental way this is pretty bad, but it's been in gcc for a long time. Andrew.