Messages in this thread | | | Date | Tue, 28 Aug 2001 13:12:29 -0400 | From | "Bill Rugolsky Jr." <> | Subject | Re: [IDEA+RFC] Possible solution for min()/max() war |
| |
On Tue, Aug 28, 2001 at 06:47:23PM +0200, Roman Zippel wrote: > Ok, it uses an assignment, but it has almost the same effect (except for > pointer/integer values).
Wrong. A cast throws away information, making meaningful warnings impossible. The assignment allows the compiler to apply the usual C integral promotions and catch narrowing and non-value-preserving conversions, like unsigned int to int, or an even more common bug, unsigned int to long, which behaves differently depending on whether long is 32 or 64 bits.
Regards,
Bill Rugolsky - 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/
| |