Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: why "(void)printf(fmt);" besides lint(1)? Message-ID: <1990May27.001120.13623@utzoo.uucp> Organization: U of Toronto Zoology References: <7486@ncar.ucar.edu> Date: Sun, 27 May 90 00:11:20 GMT In article <7486@ncar.ucar.edu> steve@groucho.ucar.edu (Steve Emmerson) writes: >Aside from getting lint(1) to shut up, why else would one write > (void)printf(fmt); >rather than the simpler > printf(fmt); Personally, this is one of the few places where I just refuse to use the cast. I consider it pointless clutter. If lint objects, tough. In the (relatively rare) event that I seriously care whether printf output got out intact (fprintf output I often care about, but not printf), I check ferror(stdout) afterwards. That also lets me do one check after a number of printfs, and avoids portability hassles over the return values. -- Life is too short to spend | Henry Spencer at U of Toronto Zoology debugging Intel parts. -Van J.| uunet!attcan!utzoo!henry henry@zoo.toronto.edu