lkml.org 
[lkml]   [2001]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [IDEA+RFC] Possible solution for min()/max() war
On Thu, 30 Aug 2001, David Woodhouse wrote:

>
>
> ionut@cs.columbia.edu said:
> > ... unless of course the programmer used an unsigned char when what he
> > really wanted was a signed char. But in that case even your typed min
> > macro won't save him, because what should the forced type be anyway?
> > If it's "int", nothing changes; if it's "signed char", you risk
> > truncating the int. So you end up with something like
>
> > min(int, a, (char)b)
>
> If the programmer wrote that when he really wanted a signed char, he has
> more fundamental brokenness to worry about than the min/max fun.

Which is precisely my point, we're in violent agreement here...

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/

\
 
 \ /
  Last update: 2005-03-22 13:01    [W:0.164 / U:12.648 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site