On Thu, Mar 13, 2003 at 08:51:44AM +0100, Lars Gullik Bjønnes wrote: > I saw another fix proposed at the boost list: > > Use [0 + c] to force integer promotion. > > Also as been mentioned on this list, why use direct setting of the > arrat anyway? Why not use the "setter" function already provided for > this?
I can live with Angus' solution in this particular case as we need to move away from the static array to some stack of such arrays if we want to handle cat code changes properly at some point of time anyway. So feel free to patch it. But I am generally not fond of making code unreadable. So an extra pair of () in 'if ((c = getchar()) {}' might be ok, but a 'static_cast<unsigned int>' is not. One of the official reasons for the new cast syntax was to make it a pain to read and write as casts generally indicate 'hot spots' and should be avoided. Using casts in perfectly valid code to circumvent a compiler warning does not serve that purpose. > | but we'd better look for a way to disable that warning in the compiler. > > No I don't agree. > > Perfectly valid warning, it is only strange in this specific case > since 'a' is used and that cannot be wrong... 'å' on the other hand... All warning are perfectly valid, as the compiler is free to issue any warning at any time... As I said, int(c) is my personal limit for the general case; for the catcodes, the setter function is ok, too. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)