preprocessor/1976: different treatment of shift in preprocessor and compiler

fl@abas.de fl@abas.de
Sun Apr 1 00:00:00 GMT 2001


>Number:         1976
>Category:       preprocessor
>Synopsis:       different treatment of shift in preprocessor and compiler
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 14 02:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     gcc
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
gcc -v:Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
uname -a: Linux fozzie 2.2.16-3 #1 Mit Jan 17 14:09:36 CET 2001 i686 unknown
>Description:
Hi,
the following programm can be compiled and produces the output
hallo


#include <stdio.h>
int main(int argc, char **argv)
{
#if 4 << 31 == 0
    blablabla
#endif

    if ((4 << 31) == 0){
        printf("hallo\n");
    }

}

This means that the precprocessor evaluates 4 << 31 == 0 to false,
however, at runtime the expression ist true.
>How-To-Repeat:
compile the mentioned program (without any options) and run it.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list