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]

c/675: Wrong warning: "large integer implicitly truncated to unsigned type"



>Number:         675
>Category:       c
>Synopsis:       Wrong warning: "large integer implicitly truncated to unsigned type"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 23 07:06:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     aj@suse.de
>Release:        gcc CVS from 2000-10-23
>Organization:
>Environment:
Linux i686
>Description:
The following small program:
#include <stddef.h>

int
main (void)
{
  size_t len;
  
  len = ~(sizeof (size_t) - 1);

  return 0;
}

gives this warning:
/opt/gcc-2.97.test/bin/gcc -Wall a.c
a.c: In function `main':
a.c:8: warning: large integer implicitly truncated to unsigned type

The warning is IMO wrong, the code is fine.
>How-To-Repeat:
Compile the test program with -Wall.
>Fix:

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

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