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]

middle-end/6694: Warning that largest negative int -2147483648 in comparison is unsigned



>Number:         6694
>Category:       middle-end
>Synopsis:       Warning that largest negative int -2147483648 in comparison is unsigned
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri May 17 06:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     R. Bernstein
>Release:        3.1, 3.0.4, and  "RedHat 2.9.6"
>Organization:
>Environment:
System: Linux muffin.peccary.sty 2.4.19-pre7-ac2 #2 Wed Apr 24 03:54:19 EDT 2002 i686 unknown
Architecture: i686

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure 
>Description:
The warning 
	warning: decimal constant is so large that it is unsigned
is given when the largest negative 32-bit value used in a comparison is used. I think the code generated is correct for i686, but there may be some architectures which for which signed comparisons and unsigned comparisons generate different code
>How-To-Repeat:
run 
  gcc -o bug gcc-large-negative-warn-bug.c 
and should see:
gcc-large-negative-warn-bug.c: In function `main':
gcc-large-negative-warn-bug.c:11: warning: decimal constant is so large that it is unsigned
Check that code is correct. (The program is very short)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc-large-negative-warn-bug.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc-large-negative-warn-bug.c"

I2luY2x1ZGUgPHN0ZGlvLmg+CmludAptYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgCnsKICAv
KiBUaGUgYmVsb3cgbGluZSBpcyB0byB2ZXJpZnkgdGhhdCB0aGlzIG51bWJlciBhIGxhcmdlIG5l
Z2F0aXZlIG51bWJlciAKICAgICBvbiB5b3VyIGFyY2hpdGVjdHVyZS4gKi8KICBwcmludGYoIiVs
ZFxuIiwgMHg4MDAwMDAwMCk7CiAgLyogQ2hlY2sgdGhhdCB0aGUgYWJvdmUgb3V0cHV0IG1hdGNo
ZXMgdGhlIHZhbHVlIGJlbG93IG9uIHlvdXIgYXJjaGl0ZWN0dXJlLgogICAgIEkgZG9uJ3QgYmVs
aWV2ZSBhIHdhcm5pbmcgc2hvdWxkIGJlIGNyZWF0ZWQgZm9yIHRoZSB2YWx1ZSBiZWxvdy4KICAq
LyAgCiAgaWYgKGFyZ2MgPT0gLTIxNDc0ODM2NDgpIHsKICAgIHByaW50ZigiY2FuJ3QgcmVhbGx5
IGhhcHBlblxuIik7CiAgfQp9Cgo=


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