[RFA] Replace strdup with xstrdup in tic30-dis.c
Andrew Cagney
ac131313@redhat.com
Tue Nov 26 16:15:00 GMT 2002
> On Tue, Nov 26, 2002 at 03:29:36PM -0800, Ian Lance Taylor wrote:
>
>> Alan Modra <amodra@bigpond.net.au> 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
More information about the Gdb
mailing list