typecasting constants

jharkins at sagpd1.uucp jharkins at sagpd1.uucp
Thu Dec 21 16:04:00 AEST 1989


From: jharkins at sagpd1.UUCP (Jim Harkins)
Orga: Scientific Atlanta-GPD, San Diego

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"

---
 * Via MaSNet/HST96/HST144/V32 - UN C Language
 * Via Usenet Newsgroup comp.lang.c



More information about the Comp.lang.c mailing list