From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17404 invoked by alias); 21 Mar 2002 11:56:07 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17372 invoked by uid 71); 21 Mar 2002 11:56:06 -0000 Date: Thu, 21 Mar 2002 03:56:00 -0000 Message-ID: <20020321115606.17369.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Joseph S. Myers" Subject: Re: c/6024: GCC fails to diagnose mismatch of enum types in prototype/function Reply-To: "Joseph S. Myers" X-SW-Source: 2002-03/txt/msg00798.txt.bz2 List-Id: The following reply was made to PR c/6024; it has been noted by GNATS. From: "Joseph S. Myers" To: Cc: , , Subject: Re: c/6024: GCC fails to diagnose mismatch of enum types in prototype/function Date: Thu, 21 Mar 2002 11:51:07 +0000 (GMT) On Thu, 21 Mar 2002, Richard Earnshaw wrote: > struct s1 {int a, int b}; > struct s2 {int c, int d}; > s1 and s2 are 'compatible'; but they aren't the same. Where in the > standard does it say that enum types are 'weak' like this? s1 and s2 aren't compatible. Compatibility is defined in 6.2.7#1, augmented by 6.7.2.2#4 (which specifies that enumerated types are compatible with char or a signed or unsigned integer type) and some other clauses. There are rules about when structure types in different translation units are compatible, but nothing that would make s1 and s2 compatible in any case. (However, I can't see anything that says that two enumerated types compatible with "int" (say) are compatible with each other either, so it isn't clear what's intended here.) -- Joseph S. Myers jsm28@cam.ac.uk