From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30937 invoked by alias); 24 Nov 2001 05:36:02 -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 30903 invoked by uid 71); 24 Nov 2001 05:36:00 -0000 Resent-Date: 24 Nov 2001 05:36:00 -0000 Resent-Message-ID: <20011124053600.30902.qmail@sourceware.cygnus.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, jsm28@cam.ac.uk Resent-Reply-To: gcc-gnats@gcc.gnu.org, David.Billinghurst@riotinto.com Received:(qmail 30012 invoked by uid 61); 24 Nov 2001 05:31:27 -0000 Message-Id:<20011124053127.30011.qmail@sourceware.cygnus.com> Date: Mon, 19 Nov 2001 21:36:00 -0000 From: David.Billinghurst@riotinto.com Reply-To: David.Billinghurst@riotinto.com To: gcc-gnats@gcc.gnu.org Cc: jsm28@cam.ac.uk X-Send-Pr-Version:gnatsweb-2.9.2 (1.1.1.1.2.21) X-GNATS-Notify:jsm28@cam.ac.uk Subject: c/4939: [cygwin] Failure of test gcc.dg/c99-intconst-1.c X-SW-Source: 2001-11/txt/msg00574.txt.bz2 List-Id: >Number: 4939 >Category: c >Synopsis: [cygwin] Failure of test gcc.dg/c99-intconst-1.c >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Nov 23 21:36:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: David Billinghurst >Release: gcc-3.1 >Organization: >Environment: i686-pc-cygwin >Description: New test gcc.dg/c99-inconst-1.c fails on cygwin. Part of the problem is missing definitions in limits.h. With these fixed, the test still fails with repeated warnings on lines 237 and 238: /usr/local/src/gcc/gcc/testsuite/gcc.dg/c99-intconst-1.c:237: warning: decimal constant is so large that it is unsigned /usr/local/src/gcc/gcc/testsuite/gcc.dg/c99-intconst-1.c:237: assignment from incompatible pointer type A reduced test case that gives the same error is /* Origin: Joseph Myers . */ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ #include /* Assertion that constant C is of type T. */ #define ASSERT_CONST_TYPE(C, T) \ do { \ typedef T type; \ typedef type **typepp; \ typedef __typeof__((C)) ctype; \ typedef ctype **ctypepp; \ typepp x = 0; \ ctypepp y = 0; \ x = y; \ y = x; \ } while (0) /* (T *) if E is zero, (void *) otherwise. */ #define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E)) /* (T *) if E is nonzero, (void *) otherwise. */ #define type_if(T, E) type_if_not(T, !(E)) /* Combine pointer types, all but one (void *). */ #define type_comb2(T1, T2) __typeof__(0 ? (T1)0 : (T2)0) #define type_comb3(T1, T2, T3) type_comb2(T1, type_comb2(T2, T3)) /* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3. */ #define first_of3p(T1, E1, T2, E2, T3, E3) \ type_comb3(type_if(T1, (E1)), \ type_if(T2, (!(E1) && (E2))), \ type_if(T3, (!(E1) && !(E2) && (E3)))) #define first_of3(T1, E1, T2, E2, T3, E3) \ __typeof__(*((first_of3p(T1, (E1), T2, (E2), T3, (E3)))0)) /* Types of constants according to the C99 rules. */ #define C99_UNSUF_DEC_TYPE(C) \ first_of3(int, (C) <= INT_MAX, \ long int, (C) <= LONG_MAX, \ long long int, (C) <= LLONG_MAX) /* Checks that constants have correct type. */ #define CHECK_UNSUF_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C99_UNSUF_DEC_TYPE((C))) void foo (void) { CHECK_UNSUF_DEC_TYPE(2147483648); } The preprocessed source from this is attached: >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="l.i" Content-Disposition: inline; filename="l.i" # 1 "l.c" # 1 "" # 1 "" # 1 "l.c" # 1 "/usr/local/obj/gcc/gcc/include/limits.h" 1 3 # 11 "/usr/local/obj/gcc/gcc/include/limits.h" 3 # 1 "/usr/local/obj/gcc/gcc/include/syslimits.h" 1 3 # 1 "/usr/local/obj/gcc/gcc/include/limits.h" 1 3 # 132 "/usr/local/obj/gcc/gcc/include/limits.h" 3 # 1 "/usr/local/lib/gcc-lib/i686-pc-cygwin/3.1/include/limits.h" 1 3 # 132 "/usr/local/lib/gcc-lib/i686-pc-cygwin/3.1/include/limits.h" 3 # 1 "/usr/include/limits.h" 1 3 # 133 "/usr/local/lib/gcc-lib/i686-pc-cygwin/3.1/include/limits.h" 2 3 # 133 "/usr/local/obj/gcc/gcc/include/limits.h" 2 3 # 8 "/usr/local/obj/gcc/gcc/include/syslimits.h" 2 3 # 12 "/usr/local/obj/gcc/gcc/include/limits.h" 2 3 # 8 "l.c" 2 # 50 "l.c" void foo (void) { int int_max = 2147483647; do { typedef __typeof__(*((__typeof__(0 ? (__typeof__(0 ? (int *)0 : (void *)(!(((((2147483648)) <= 2147483647))))))0 : (__typeof__(0 ? (__typeof__(0 ? (long int *)0 : (void *)(!((!((((2147483648)) <= 2147483647)) && ((((2147483648)) <= 2147483647L)))))))0 : (__typeof__(0 ? (long long int *)0 : (void *)(!((!((((2147483648)) <= 2147483647)) && !((((2147483648)) <= 2147483647L)) && ((((2147483648)) <= 9223372036854775807LL)))))))0))0))0)) type; typedef type **typepp; typedef __typeof__(((2147483648))) ctype; typedef ctype **ctypepp; typepp x = 0; ctypepp y = 0; x = y; y = x; } while (0); }