From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12276 invoked by alias); 27 Nov 2002 00:15:03 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12263 invoked from network); 27 Nov 2002 00:15:02 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 27 Nov 2002 00:15:02 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 901F43F30; Tue, 26 Nov 2002 19:14:56 -0500 (EST) Message-ID: <3DE40E80.2070801@redhat.com> Date: Tue, 26 Nov 2002 16:15:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alan Modra Cc: klee@apple.com, binutils@sources.redhat.com, gdb@sources.redhat.com Subject: Re: [RFA] Replace strdup with xstrdup in tic30-dis.c References: <4D2AFB6A-FD1E-11D6-B723-00039396EEB8@apple.com> <3DE3EFC4.2010209@redhat.com> <20021126223746.GQ949@bubble.sa.bigpond.net.au> <20021126235733.GX949@bubble.sa.bigpond.net.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00380.txt.bz2 > On Tue, Nov 26, 2002 at 03:29:36PM -0800, Ian Lance Taylor wrote: > >> Alan Modra writes: >> > >> > Hmm, I'm inclined to just use "int" directly rather than introduce a >> > "bfd_boolean". Unless I hear objections, that's what I'll do one of >> > these days.. > >> >> I tend to think that bfd_boolean is better because it makes the code >> slightly more self-documenting. An int variable might hold any value, >> but a bfd_boolean variable is clearly intended to hold only a true or >> false value. In C, there is zero and non-zero. There is no true or false. What ever the function's type, its the avoidance of: if (bfd_foo_p() == TRUE) that is important. > Yes, I agree that it's more self-documenting, but even better is to > use function names that are obviously predicates. My reason for > disliking the typedef is that it hides the real type in the same > way that macros hide things. When it comes to debugging code you > inevitably hit a situation where you need to ignore all the > documentation and look at all macros and typedefs to see what is > really going on. > > >> But I'm hardly fanatical about it. > > > Nor am I. :) So far, it's two people for "bfd_boolean", one for > "int". Andrew