Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 03 May 2011 06:50:11 -0500 Message-ID: <4DBFEBF4.5147@mindspring.com> Date: Tue, 03 May 2011 07:50:12 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: Return value for error References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 17 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.222.203 X-Trace: sv3-4uQmRyiXbCB5Em7CL1gKe1V4Vq2IdRF6EstzYBj6rNjq1IkpKqoMMKREg8+2qjU7DO0n4I/KhjwM3Zb!g8zRHAm1K16rjB5RBfDjteJL/mbGiBHbBnILicYBWKo08n5fxQsHhDKAoqYaPhTL8CQonh82Q04u!iZ2Exm2m7M4= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1511 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:3171 pozz wrote: > > A very simple question. What do you use as the return value of a > function for error/ok results? > I can't decide between 0 for error and !=0 for ok, or 0 for ok and !=0 > for errors. When there may be several various error return codes, then use 0 for success. When there are *not* several various error return codes, such as in the isspace function and the the other functions, then use 0 for failure. -- pete