min/max and types

eric pouech eric.pouech at wanadoo.fr
Thu Sep 20 14:03:20 CDT 2001


(resent because of mail issues)

still thinking about it, there is however some points I don't like (and
especially for keeping it permanent)
errors we want to catch are mainly related to sign mismatch
(like min(char, unsigned short)...)

however, comparaisons like min(short, int) or min(size_t, DWORD) don't
provide lots of errors. integral promotions are straightforward, and
behave as expected by any programmer. so it would be rather ugly IMO
to write something like min((int)s, i) (s being short and i int)

on the other hand, in the case of min(char, unsigned short), only
experienced programmers are able to tell the order of integral
promotions
involved here, and we really do need some guidance here. unfortunately, 
I don't see any ways not to let the min/max macro only spit errors on 
integral type of same sign-ness

A+-- 
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle




More information about the wine-devel mailing list