"#if sizeof(char *) < sizeof(int)"

tjt at kobold.UUCP tjt at kobold.UUCP
Thu Feb 9 03:48:58 AEST 1984


So whats wrong with:

	if ((sizeof(char *) > sizeof(int)) {
		. . .
	}

The compiler should evaluate the conditional at compile time and skip
the dead code (although many UNIX C compilers rely on the peephole
optimizer to remove the dead code).

#ifdef and so on should only be necessary for conditionally including
#define's, #include's and declarations which cannot possibly be handled
by an ordinary if.
-- 
	Tom Teixeira,  Massachusetts Computer Corporation.  Westford MA
	...!{ihnp4,harpo,decvax}!masscomp!tjt   (617) 692-6200 x275



More information about the Comp.lang.c mailing list