Re: [IDEA+RFC] Possible solution for min()/max() war

Ion Badulescu (ionut@cs.columbia.edu)
Thu, 30 Aug 2001 13:45:57 -0400 (EDT)


On Thu, 30 Aug 2001 mike_phillips@urscorp.com wrote:

> > So I have this number, -200, which is stored in an int. I have this
> other
> > number, 200, which is stored in an unsigned char. Everybody in his right
> > mind will agree that -200 is smaller than 200, the compiler will do just
> > that, yet you disagree???
>
> Now try doing that with an int and an unsigned int, you'll get 200, not
> -200.

You'll get a warning with -Wsign-compare, which is what the argument was
all about.

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/