home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!ukma!asuvax!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mksol!mccall
- From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
- Subject: Re: How to use 'return' in c?
- Message-ID: <1992Nov9.190838.3391@mksol.dseg.ti.com>
- Organization: Texas Instruments Inc
- References: <1992Nov7.122126.24409@druid.uucp> <gm5XTB3w165w@quest.UUCP>
- Date: Mon, 9 Nov 1992 19:08:38 GMT
- Lines: 26
-
- In <gm5XTB3w165w@quest.UUCP> kdq@quest.UUCP (Kevin D. Quitt) writes:
-
- >darcy@druid.uucp (D'Arcy J.M. Cain) writes:
-
- >> allebrandi@ipact.com writes:
- >> >The best thing to do is to use manifest constants to implicitly document
- >> >the value you are returning. For example, return TRUE or FALSE not 1 or
- >> >0 for a boolean function return.
- >>
- >> Whenever I see TRUE and FALSE in code I am maintaining I remove the
- >> #defines. If they are defined, they should never be anything but
- >> TRUE = 1 and FALSE = 0. Anything else is confusing and misleading.
-
- > On the other hand, since C does not truly support the boolean type,
- >I consider it misleading to assign a numeric value to a boolean. I
- >define TRUE as (1==1) because the result of this is a boolean - the
- >fact that it is represented by a numerical value is misleading.
-
- No, the result of this is *1*. If it is anything else, your compiler
- is seriously broken.
-
- --
- "Insisting on perfect safety is for people who don't have the balls to live
- in the real world." -- Mary Shafer, NASA Ames Dryden
- ------------------------------------------------------------------------------
- Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
-