public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: David.Billinghurst@riotinto.com To: gcc-gnats@gcc.gnu.org Cc: jsm28@cam.ac.uk Subject: c/4939: [cygwin] Failure of test gcc.dg/c99-intconst-1.c Date: Mon, 19 Nov 2001 21:36:00 -0000 [thread overview] Message-ID: <20011124053127.30011.qmail@sourceware.cygnus.com> (raw) >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 <jsm28@cam.ac.uk>. */ /* { dg-do compile } */ /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ #include <limits.h> /* 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 "<builtin>" # 1 "<command line>" # 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); }
next reply other threads:[~2001-11-24 5:36 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-11-19 21:36 David.Billinghurst [this message] 2001-11-20 0:06 jsm28 2001-11-20 0:36 jsm28 2002-06-09 6:09 neil
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20011124053127.30011.qmail@sourceware.cygnus.com \ --to=david.billinghurst@riotinto.com \ --cc=gcc-gnats@gcc.gnu.org \ --cc=jsm28@cam.ac.uk \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).