Re: INT_MIN and compiler diagnostic



On 2007-02-28 09:01:31 -0800, strangerdream@xxxxxxxxx said:

On Feb 28, 7:14 pm, "*** T. Winter" <***.Win...@xxxxxx> wrote:
<snip>
There are no negative constants in C.

But the warning message says:
warning: this decimal constant is unsigned only in ISO C90

What is a signed constant then?

It is a constant with a signed type (i.e. int or long). Just because something is signed doesn't mean that it is negative. Under C90, a constant to large to fit in a long would have the type (unsigned long). Under C99, this is different (because of the addition of long long and the associated changes to the promotion rules)


.


Quantcast