public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: eric_dana@bmc.com
To: gcc-gnats@gcc.gnu.org
Cc: dick_schoeller@bmc.com
Subject: preprocessor/5806: The preprocessor evaluates expression s in 64-bit, violating IS C++ 16.1.4
Date: Fri, 01 Mar 2002 12:16:00 -0000	[thread overview]
Message-ID: <20020301201205.24986.qmail@sources.redhat.com> (raw)


>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 <stdio.h>

main ()
{
  printf("sizeof long = %d\n", sizeof(long));
  printf("C preprocessor thinks the size is: %s\n", MYSIZESTRING);
}


             reply	other threads:[~2002-03-01 20:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-01 12:16 eric_dana [this message]
2002-03-01 13:36 Zack Weinberg
2002-03-01 15:16 Neil Booth
2002-03-14 11:46 Zack Weinberg
2002-03-14 13:06 Dana, Eric
2002-03-14 13:06 'Neil Booth'
2002-03-14 15:16 'Zack Weinberg'
2002-03-15  8:56 Dana, Eric
2002-03-25  0:53 neil
2002-05-26 12:16 neil
2002-05-27 13:35 neil
2002-08-03  0:56 'Zack Weinberg'
2002-08-05 15:26 Dana, Eric

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=20020301201205.24986.qmail@sources.redhat.com \
    --to=eric_dana@bmc.com \
    --cc=dick_schoeller@bmc.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /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: link
Be 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).