casts to (void) [considered harmful]

Simson L. Garfinkel simsong at mit-eddie.UUCP
Thu Aug 8 01:33:22 AEST 1985


In article <2564 at sun.uucp> guy at sun.uucp (Guy Harris) writes:
>It's unfortunate that so much effort has to be wasted on silencing harmless
>"lint" complaints, but as anybody who's tried porting code to machines which
>don't fit the VAX model of the world (32-bit "int"s, 32-bit pointers, signed
>characters, little-endian byte order, etc.) will tell you, better to run
>"lint" on the code and either spend the effort (void)ing everything or
>filtering out the harmless complaints than to spend the effort on several
>extra compile/run/debug/edit/compile... cycles fixing the problems caused by
>code that assumes that model of the world.  (I've done it; I know whereof I
>speak.)
>
>	Guy Harris


Normally, when I am working on a project that must be transportable, I
use a file on my system called "COMPILER_DEPENDENCIES.h" On a VAX, this
file looks like this:

#typedef int32 unsigned int
#typedef int16 unsigned short int
.
.
.

On my IBM/PC (lattice C, UGH!), the file is "COMP_DPD.h" and it looks
like this:

#typedef int32 unsigned long int
#typedef int16 unsigned int

I use sint16 for signed integers. Then, throughout the code, no int's,
just int16 or 32, depending on what. I want.

Hope this helps.


................................................................simson



More information about the Comp.lang.c mailing list