Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!kth!sunic!liuida!prodix!isadora!hacker From: hacker@isadora.ikp.liu.se (Goran Larsson [Hacker of Hackefors]) Newsgroups: comp.lang.c Subject: Re: lint won't verify printf formatting against variable types?? Keywords: lint, cc Message-ID: <413@isadora.ikp.liu.se> Date: 30 Jun 89 06:51:44 GMT References: <328@tree.UUCP> <417@siswat.UUCP> <27729@lll-winken.LLNL.GOV> <115@borabora.omni.com> Organization: Hackers Home, Hackefors, Linkoping, Sweden Lines: 31 In article <115@borabora.omni.com> bob@omni.com (Bob Weissman) writes: >I'm talking about > if (expression); >which, while legal, *never* makes sense semantically, as it is always >equivalent to > expression; > >OK? NO, NO, NO, NO! It does make sense sometimes, take this for example: #define WATCHDOG {if (*( (char *)0x80007 ));} Whenever you use this macro it will be compiled as "tstb 0x80007" (68k) wich is the smallest and fastest way of kicking the watchdog without side effects (assignment to dummy variable etc.) Talking about equivalence, I cant see that if (*( (char *)0x80007 )); is equivelant to *( (char *)0x80007 ); as the later does not generate any code at all! ! _ ! ! Goran Larsson [The Hacker of Hackefors] --+-! Hackefors, Linkoping, SWEDEN (See) +46 13-155535 (Hear) !-+-- ...!uunet!sunic!liuida!prodix!isadora!hacker (UUCP) ! ! hacker@isadora.ikp.liu.se (Internet) _ ! This signature is Cosylight (C) 1989 by Goran Larsson