Path: utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!ucsd!swrinde!cs.utexas.edu!asuvax!anasaz!duane From: duane@anasaz.UUCP (Duane Morse) Newsgroups: comp.lang.c Subject: Re: Discarded Function Values (To Cast or Not to Cast) Summary: Make lint happy - it's worth the effort Message-ID: <913@anasaz.UUCP> Date: 17 Nov 89 22:49:31 GMT References: <316@voa3.UUCP> Organization: Anasazi Inc., Phoenix AZ Lines: 19 In article <316@voa3.UUCP>, ck@voa3.UUCP (Chris Kern) writes: [ My compiler (pcc) is agnostic about discarding the value from a [ function call. Lint, of course, protests. [ If it's my function, I presumably will declare it to be void if [ it doesn't return a value and will use the value if it does return [ one. But what about a standard library function whose value I [ (perhaps recklessly) wish to ignore? Should I cast the function [ call to void, or am I just indulging in the trivial luxury of [ silencing lint? We've found that lint catches programmer bugs often enough to make it worthwhile to do the casts of standard library functions, so much so that we require all programs to 'pass' lint before they can be released. Lint can point out bugs that would take a programmer hours to find, so we believe there's no excuse _not_ to use lint. -- Duane Morse e-mail: duane@anasaz (or ... asuvax!anasaz!duane) (602) 861-7609