Re: INT_MIN and compiler diagnostic
- From: "bytebro" <keith.willis@xxxxxxxxx>
- Date: 28 Feb 2007 03:15:33 -0800
On 28 Feb, 10:07, p_cricket_...@xxxxxxxxxxx wrote:
When I compile this using gcc, I get a diagnostic on line 7:
[pcg@mylinux test]$gcc -ansi -pedantic -Wall -o /tmp/x /tmp/x.c
/tmp/x.c: In function `main':
/tmp/x.c:7: warning: this decimal constant is unsigned only in ISO C90
On mine (Sun sparc) using gcc with exactly the same flags I get
x.c:7: warning: decimal constant is so large that it is unsigned
The program output is:
INT_MAX = 2147483647 INT_MIN = -2147483648
x = -2147483648 y = -2147483648
So amusingly, it tells me the constant is unsigned, then prints it
signed.
Where's a language lawyer when you need one?!
.
- Follow-Ups:
- Re: INT_MIN and compiler diagnostic
- From: Chris Torek
- Re: INT_MIN and compiler diagnostic
- From: pete
- Re: INT_MIN and compiler diagnostic
- Prev by Date: Re: Polyspace Problem
- Next by Date: Re: INT_MIN and compiler diagnostic
- Previous by thread: Polyspace Problem
- Next by thread: Re: INT_MIN and compiler diagnostic
- Index(es):
Relevant Pages
|