Path: utzoo!yunexus!ists!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: comp.lang.c Subject: Re: Discarded Function Values (To Cast or Not to Cast) Message-ID: <1989Nov18.062322.12728@twwells.com> Date: 18 Nov 89 06:23:22 GMT Article-I.D.: twwells.1989Nov18.062322.12728 References: <316@voa3.UUCP> <1989Nov17.154621.2698@aqdata.uucp> Organization: None, Ft. Lauderdale, FL Lines: 22 In article <1989Nov17.154621.2698@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes: : From article <316@voa3.UUCP>, by ck@voa3.UUCP (Chris Kern): : > ... Should I cast the function : > call to void, or am I just indulging in the trivial luxury of : > silencing lint? : : Although you are merely silencing lint, you are also doing yourself : a service. If you start letting warnings like "return value ignored" : pop up then you will someday miss an real warning/error message that : is buried amongst the "fake" warning/error messages. Silence as many : lint warnings as you can (will somebody PLEASE do something about the : malloc bugaboo) and the real ones will stand out easily. I don't worry about lint warnings about functions whose return value is never used. It is generally a very short list, things like strcpy and the like, where the return value is never of interest to me. I use a cast to void when I ignore the return value of a function whose return value is used elsewhere. --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com