Path: utzoo!attcan!uunet!apctrc!drd!mark From: mark@DRD.Com (Mark Lawrence) Newsgroups: comp.lang.c Subject: Re: Assignment in test: OK? Message-ID: <1990Sep26.124155.9856@DRD.Com> Date: 26 Sep 90 12:41:55 GMT References: <1990Sep7.042759.3804@ux1.cso.uiuc.edu> <0atunAG00VosQ2nkcN@andrew.cmu.edu> Distribution: na Organization: DRD Corporation Lines: 18 jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) wrote: } [...] However, I think the intent of the original code was to } perform an assignment and then do a test on the result (look carefully; } there's a > or < in there somewhere), similar to the following, which I } use all the time: } } if ( ( file_ptr = fopen (filename, mode) ) == NULL ) } { } /* print a message and exit */ } } right. I posted the original article. The most severe caution I got was about readability. My concern was that Saber C would give a warning on code just like the above and I've learned to take Saber's warnings seriously. In this case, I'll just suppress the warning. Thanks, all, for an illuminating thread of discussion. -- mark@DRD.Com uunet!apctrc!drd!mark$B!J%^!<%/!!!&%m!<%l%s%9!K(B