Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!bbn.com!papaya.bbn.com!rsalz From: rsalz@bbn.com (Rich Salz) Newsgroups: comp.lang.c Subject: Re: Assignment in test: OK? Message-ID: <2868@litchi.bbn.com> Date: 28 Sep 90 13:34:49 GMT References: <1990Sep7.042759.3804@ux1.cso.uiuc.edu> <0atunAG00VosQ2nkcN@andrew.cmu.edu> <1990Sep26.124155.9856@DRD.Com> Distribution: na Organization: BBN Systems and Technology, Inc. Lines: 33 In <1990Sep26.124155.9856@DRD.Com> mark@DRD.Com (Mark Lawrence) writes: [Saber "complains" about the following] >} if ( ( file_ptr = fopen (filename, mode) ) == NULL ) >} { >} /* print a message and exit */ >} } > 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. Gee, I'm confused. The following fragment generated no warnings whatsoever: #include main() { FILE *F; if ((F = fopen("t.out", "w")) == NULL) printf("Open failure"); else { printf("Open fine\n"); (void)fclose(F); } } Perhaps something else is going on in your code? This is with version 2.1, and with suppressesion 357,358 (using result of ?: or cast as an lvalue) turned OFF. /r$ -- Please send comp.sources.unix-related mail to rsalz@uunet.uu.net. Use a domain-based address or give alternate paths, or you may lose out.