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]
Other format: [Raw text]

[Bug c/17785] New: false warning in GCC


Version: gcc 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
OS: Red Hat Linux, kernel version 2.4.20-34.9
Host:Pentium III (Coppermine), 512MB RAM

I am only a regular user, not a superuser and don't know options used to make 
gcc.

I compiled the following program with command line: gcc a.c

int main()
{
  int i=0;
  long long a;
  a = 0xFFFFFFFFF;
  i = (a < 0x1000000000);
  printf("result = %i\n",i);
  a = 0x1000000001;
  i = (a < 0x1000000000);
  printf("result = %i\n",i);
}

This program should be completely fine, but gcc reports the following false 
warnings:

a.c: In function `main':
a.c:6: warning: integer constant is too large for "long" type
a.c:7: warning: integer constant is too large for "long" type
a.c:9: warning: integer constant is too large for "long" type
a.c:10: warning: integer constant is too large for "long" type


Similar problem on gcc 3.4.1 on a Sun Ultra60 workstation running SunOS 5.8

-- 
           Summary: false warning in GCC
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jywang at purdue dot edu
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17785


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