Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!inuxc!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: (So-Called) ANSI C Summary: Actually about Turbo C warnings Message-ID: <1821@bsu-cs.UUCP> Date: 9 Jan 88 04:53:36 GMT References: <4668@pyr.gatech.EDU> <495@xyzzy.UUCP> <9930@mimsy.UUCP> <6996@brl-smoke.ARPA> <10027@ut-sally.UUCP> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 19 In article <10027@ut-sally.UUCP> nather@ut-sally.UUCP (Ed Nather) writes: [about constructs such as "if (a = getinput())"] >It isn't a typo. I use it all the time to assign a value to a variable, >then test the result. I find it seriously irritating that Turbo C >crabs about the construction. I can't verify this right now (it takes forever to reboot out VAX to run MSDOS :-), but I seem to recall that while Turbo C will complain about if (a = getinput()) (and I think it ought to), it will not complain about the equivalent if ((a = getinput()) != 0) since you are making your intention clear, both to the human reader and to the compiler. I think Datalight C makes the same distinction. -- Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi