Eh? "0" is a signed integer constant. So your comparisons force promotion
to int when x is smaller size. I'm not sure what type
"unsigned foo - signed int"
would have either! It seems to me that you are making things very
murky, which is precisely what you want to avoid.
> check isn't needed. A MIN(int, long) etc should probably be ok. The
> only caveats are the promotion in the __MIN itself create a sign
> mismatch.
>
> However, if the `sizeof' check remains, then you don't have to worry
> about this and both versions are equivalent. Some other things to
> worry about is what if the type is already const? Maybe that works...
No parsum.
> What if you try `MIN(x,_x);'. I think that this is something that
> David took care of in the "3 arg min".
You can't take care of it. A macro is always vulnerable to name
clashes.
Peter
-
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/