This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bogus warning: integer constant too large



I've been able to produce this with both gcc 2.7.2.3 and egcs 1.1.1.
In both cases, it was on an x86 linux machine.
Here's a little test program to produce the bogus warning:

#include <stdio.h>

long foo1 = (-2147483648); /* produces the warning */
long foo2 = 0x80000000;    /* doesn't produce the warning */

int main() {
    if (foo1 == foo2) {
        printf("They are the same!\n");
    } else {
        printf("They are different!\n");
    }
    return 0;
}

Brad Garcia
   ___/  __ /  __ /  ___/ "Being the Linux of digital media
  __/   /  /  / _/  __/    would be a very good life."
_/    ____/ _/ _| ____/      - Jean-Louis Gassee, CEO of Be, Inc.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]