From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 793 invoked by alias); 1 Mar 2002 20:16: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 735 invoked by uid 71); 1 Mar 2002 20:16:01 -0000 Resent-Date: 1 Mar 2002 20:16:01 -0000 Resent-Message-ID: <20020301201601.733.qmail@sources.redhat.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, dick_schoeller@bmc.com Resent-Reply-To: gcc-gnats@gcc.gnu.org, eric_dana@bmc.com Received:(qmail 24988 invoked by uid 61); 1 Mar 2002 20:12:05 -0000 Message-Id:<20020301201205.24986.qmail@sources.redhat.com> Date: Fri, 01 Mar 2002 12:16:00 -0000 From: eric_dana@bmc.com Reply-To: eric_dana@bmc.com To: gcc-gnats@gcc.gnu.org Cc: dick_schoeller@bmc.com X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify:dick_schoeller@bmc.com Subject: preprocessor/5806: The preprocessor evaluates expression s in 64-bit, violating IS C++ 16.1.4 X-SW-Source: 2002-03/txt/msg00010.txt.bz2 List-Id: >Number: 5806 >Category: preprocessor >Synopsis: The preprocessor evaluates expression s in 64-bit, violating IS C++ 16.1.4 >Confidential: no >Severity: serious >Priority: high >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Mar 01 12:16:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Eric Dana >Release: GCC 3.0.4 and possibly GCC 3.1 >Organization: >Environment: AIX, Solaris, Sequent and others >Description: The preprocessor evaluates expressions using 64-bits, violating ISO C++ 16.1.4 and 5.19. The problems is generic and can be easily reproduced. This causes the 32/64 bit test on Sequent provided header files to be incorrectly parsed. The vendor compilers work according to the standard. >How-To-Repeat: On Solaris (64-bit): cc ed.c a.out cc -xarch=v9 ed.c (64-bit build) a.out gcc ed.c a.out On all OS's: cc ed.c a.out gcc ed.c a.out >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="ed.c" Content-Disposition: inline; filename="ed.c" #if 0 #if ((~0UL) == (0xffffffffUL)) #define MYSIZESTRING "32 bit" #else #define MYSIZESTRING "64 bit" #endif #endif #define MYSIZESTRING "foo" #include main () { printf("sizeof long = %d\n", sizeof(long)); printf("C preprocessor thinks the size is: %s\n", MYSIZESTRING); }