Messages in this thread | | | Date | Tue, 28 Aug 2001 19:28:43 +0200 | From | Roman Zippel <> | Subject | Re: [IDEA+RFC] Possible solution for min()/max() war |
| |
Hi,
"Bill Rugolsky Jr." 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.
Do you have an example? AFAIK this can only be done for constants and mosts constants used with min are within usual integer limits.
bye, Roman - 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/
| |