This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/675: Wrong warning: "large integer implicitly truncated to unsigned type"
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/675: Wrong warning: "large integer implicitly truncated to unsigned type"
- From: aj at suse dot de
- Date: 23 Oct 2000 14:00:28 -0000
- Reply-To: aj at suse dot de
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, aj@suse.de
>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: