Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!think!mit-eddie!simsong From: simsong@mit-eddie.UUCP (Simson L. Garfinkel) Newsgroups: net.lang.c Subject: Re: casts to (void) [considered harmful] Message-ID: <4894@mit-eddie.UUCP> Date: Wed, 7-Aug-85 11:33:22 EDT Article-I.D.: mit-eddi.4894 Posted: Wed Aug 7 11:33:22 1985 Date-Received: Sat, 10-Aug-85 23:34:36 EDT References: <11@brl-tgr.ARPA> <> <168@telesoft.UUCP> <493@h-sc1.UUCP> <2564@sun.uucp> Reply-To: simsong@mit-eddie.UUCP (Simson L. Garfinkel) Organization: MIT, Cambridge, MA Lines: 37 In article <2564@sun.uucp> guy@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