lkml.org 
[lkml]   [2001]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [IDEA+RFC] Possible solution for min()/max() war
Date
On August 29, 2001 03:13 am, Linus Torvalds wrote:
> On Wed, 29 Aug 2001, Daniel Phillips wrote:
> >
> > min(host->scsi.SCp.this_residual, (unsigned) DMAC_BUFFER_SIZE / 2);
>
> Sure.
>
> If you put the type information explicitly, you can get it right.
>
> Which is, btw, _exactly_ why the min() function takes the type explicitly.

My point is that proper programming discipline would have prevented the
problem from arising in the first place. It would be far more appropriate
for kernel programmers to exercise such discpline than to treat them like
babies, breaking well-known syntax in the process.

It seems trivial to pick up all potential min/max problems with the Stanford
Checker in the case some programmer has been too clueless to think about
their code as they write it. A simple policy statement for users of min/max
would have avoided this entire mess.

Not that I you're going to back down, it just made me feel better to get this
off my chest ;-)

--
Daniel
-
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.155 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site