Mr. Viro,
OK. The existing API is wrong and the new min()/max() macros are the
right way to properly compare values. However, we could always add a config
option to enable a compatibility macro, which would use typeof() on one of the
two variables and then call the real min()/max(). Something like this (just an
example):
#ifdef CONFIG_ALLOW_COMPAT_MINMAX
#define proper_min(t, a, b) ((t)(a) < (t)(b) ? (a) : (b))
#define proper_max(t, a, b) ((t)(a) > (t)(b) ? (a) : (b))
#define min(a, b) proper_min(typeof(a), a, b)
#define max(a, b) proper_max(typeof(a), a, b)
#else
#define min(t, a, b) ((t)(a) < (t)(b) ? (a) : (b))
#define max(t, a, b) ((t)(a) < (t)(b) ? (a) : (b))
#endif
Unfortunately, this would violate your idea that "hiding" the real
code behind compatibility stuff is C++esque, and, IYO, an Evil Thing(tm). That
just leaves me with one question to everybody:
<rant type="question" intensity="30%">
Why did Linus change this out of /dev/null and suddenly run off!?
</rant>
Brad
=====
Brad Chapman
Permanent e-mail: kakadu_croc@yahoo.com
Current e-mail: kakadu@adelphia.net
Alternate e-mail: kakadu@netscape.net
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
-
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/