typecasting constants

Flame Bait joshua at athertn.Atherton.COM
Thu Dec 21 12:29:30 AEST 1989


In article <563 at sagpd1.UUCP> jharkins at sagpd1.UUCP (Jim Harkins) writes:
>Our customer is trying to force a coding standard rule down our throats...
>This means we'll have
>
>#define FRED ((long) 4)
>#define WILMA  ((short) 9)
>
>whats a good argument against this?

If you have something like this:
#define NAME_SIZE (long)300
and then this code:
char name[NAME_SIZE] ;

Then some (all?) VMS C compilers will become very angry.  I do not think
they will compile the code, but I know they will complain.   

Why does your customer want you to do this?  

Joshua Levy                          joshua at atherton.com  home:(415)968-3718
                        {decwrl|sun|hpda}!athertn!joshua  work:(408)734-9822 



More information about the Comp.lang.c mailing list