From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15266 invoked by alias); 27 May 2002 19:22:22 -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 15237 invoked by uid 61); 27 May 2002 19:22:21 -0000 Date: Mon, 27 May 2002 13:35:00 -0000 Message-ID: <20020527192221.15236.qmail@sources.redhat.com> To: dick_schoeller@bmc.com, eric_dana@bmc.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, neil@gcc.gnu.org From: neil@gcc.gnu.org Reply-To: neil@gcc.gnu.org, dick_schoeller@bmc.com, eric_dana@bmc.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, neil@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: preprocessor/5806: The preprocessor evaluates expression s in 64-bit, violating IS C++ 16.1.4 X-SW-Source: 2002-05/txt/msg00883.txt.bz2 List-Id: Synopsis: The preprocessor evaluates expression s in 64-bit, violating IS C++ 16.1.4 State-Changed-From-To: analyzed->closed State-Changed-By: neil State-Changed-When: Mon May 27 12:22:20 2002 State-Changed-Why: After some recent patches of mine, GCC 3.2 does preprocessor arithmetic to the precision of the target's intmax_t, as required by the C99 standard. As you can see from a discussion in the last two days on GCC-patches mailing list, it was decided that we should do this in C89 mode as well, otherwise there is no consistent way for us to have the long-long extension. Now, you claim it violates the ISO C++ and C89 standards. In fact it does not; if you read the relevant section carefully, it says that CPP arithmetic is done to *at least* the precision of the target "long" type. By using intmax_t, we are in compliance with this requirement: "... the controlling constant expression ... is evaluated according to the rules of 6.4 using arithmetic that has *at least* the ranges specified in 5.2.4.2, except that int and unsigned int act as if they have the same representation as, respectively, long and unsigned long." Because of this wording, any code that relied on the C89 preprocessor to determine properties of the target machine precision was always broken. Thanks for the bug report. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5806