Path: utzoo!censor!isgtec!robert From: robert@isgtec.UUCP (Robert Osborne) Newsgroups: comp.lang.c Subject: Re: Constants in conditionals Message-ID: <874@isgtec.UUCP> Date: 28 Feb 91 00:03:55 GMT References: <9890@dog.ee.lbl.gov> <1991Feb18.113919.28217@watmath.waterloo.edu> <858@isgtec.UUCP> <1991Feb21.121452.29969@watmath.waterloo.edu> Sender: news@isgtec.UUCP Reply-To: robert@isgtec.UUCP Organization: IAP Group, ISG Technologies Lines: 30 In article <1991Feb21.121452.29969@watmath.waterloo.edu>, datangua@watmath.waterloo.edu (David Tanguay) writes: #In article <858@isgtec.UUCP> robert@isgtec.UUCP (Robert Osborne) writes: #|datangua@watmath.waterloo.edu (David Tanguay) writes: #|> "if( PATCH_MODE ) { ... }", where PATCH_MODE is a cpp macro (0 or 1). #|> I know I coud use #if (or #ifdef), but I find them too ugly. #|Nice attitude towards programming; #|"I don't use any language constructs *I* don't find aesthetically pleasing" # #Same one you're advocating: if( constant ) is a valid language construct #that you don't want anybody to use (i.e., you want the compile to warn #people off of it). No, not the same at all. I want a warning because, like most people, when I have a constant in a conditional it is usually a mistake. If it isn't then I ignore the warning. Note that i = 0; start_loop: if( i >= 10 ) goto end_loop; ... i++; goto start_loop; end_loop: is a "valid language construct" but most people use for(i=0; i<10;i++) { ... } Rob. ---- Robert A. Osborne ...uunet!utai!lsuc!isgtec!robert or robert@isgtec.uucp