Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!ppcnet!ppcger!Sepp From: Sepp@ppcger.ppc.sub.org (Josef Wolf) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <3zmEVD@ppcger.ppc.sub.org> Distribution: world Date: 19 Mar 91 21:41:54 GMT References: <1991Mar17.184930.15049@colorado.edu> <4wFZy1w163w@cybrspc> Lines: 32 roy%cybrspc@cs.umn.edu (Roy M. Silvernail) writes: ] rainer@boulder.Colorado.EDU (Rainer Malzbender) writes: ] > I believe my Datalight (Zortech) compiler actually issues a warning if you ] > say "if(a=b)", something like "possible unintended assignment". ] Turbo also issues "Possibly incorrect assignment" for constructs like ] 'if(x=get_key())...'. Do you really want this? Do you really want the compiler crying every time you write something like the following (just an example) while ( get_data (...) && (p = malloc (...))) { ... } well, you could write something like while (get_data (...)) { p = malloc (...); if (!p) break; ... } but the first one seems to be more clearly to me... Greets Sepp | Josef Wolf, Germersheim, Germany | +49 7274 8047 -24 Hours- (call me :-) | ...!ira.uka.de!smurf!ppcger!sepp | +49 7274 8048 -24 Hours- | sepp@ppcger.ppc.sub.org | +49 7274 8967 18:00-8:00, Sa + Su 24h | "is there anybody out there?" | all lines 300/1200/2400 bps 8n1