Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: Subroutine layout in C Message-ID: <1152@goofy.megatest.UUCP> Date: 7 Jan 89 01:00:36 GMT References: <18789@agate.BERKELEY.EDU> Organization: Megatest Corporation, San Jose, Ca Lines: 29 From article <18789@agate.BERKELEY.EDU>, by bowles@eris.berkeley.edu (Jeff A. Bowles): > Some people use: > typedef enum {true = 1, false = 0} boolean; > and when you're able to use this single line, and later say "if (true)..." > I'll probably use this - it DOES make things clearer. I can't agree. I know of one _extremely_ large project where several programmers have defined "YES" and "NO" and "TRUE" and "FLASE". So you get "redefined" messages if you need to include header files from two different packages. To make things worse, one programmer who was unfamiliar with C conventions defined "YES" as 0 and "NO" as 1. Gack. His header files will break all the other ones. That sort of proves that an SLM was out of place: It has to mean what it means. If you change the #define, you change the logic and break the program. I've noticed that some released Sun software gets "redefined" messages. In one header file there is something like this: #define true (0==0) and in another #define true (0!=1) or something like that. Pooh.