From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 718 invoked by alias); 19 May 2005 14:02:49 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29737 invoked by uid 48); 19 May 2005 14:00:13 -0000 Date: Thu, 19 May 2005 14:02:00 -0000 From: "rguenth at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050519140009.21664.rguenth@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/21664] New: array-of-empty-structure extension not properly defined X-Bugzilla-Reason: CC X-SW-Source: 2005-05/txt/msg02595.txt.bz2 List-Id: For struct {} a[4]; int main() { return &a[2] - &a[1]; } the C frontend emits return 0 /[ex] 0; which will, at -O0 fault at runtime, at -O not due to RTL CSE. Is this even well-defined? Should the C-frontend rather emit return 0; ? Of course this contradicts the C standard, but that does not allow empty structures anyway. -- Summary: array-of-empty-structure extension not properly defined Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21664