typecasting constants

Jim Harkins jharkins at sagpd1.UUCP
Wed Dec 20 12:09:19 AEST 1989


Our customer is trying to force a coding standard rule down our throats
that we don't like, but can't give an argument on why we hate it.  The
rule is "All constants will have their types explicitly specified."
This means we'll have

#define FRED ((long) 4)
#define WILMA  ((short) 9)

Outside of the fact that nobody else ever does this, and we've never had
a problem omitting the typecasts, whats a good argument against this?
Note we don't have a problem with things like '0x42L' when we know it
has to be a long.

jim
"Only dead fish go with the flow"



More information about the Comp.lang.c mailing list