This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] sim: dv-cfi: include stdbool.h
- From: Mike Frysinger <vapier at gentoo dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org, toolchain-devel at blackfin dot uclinux dot org
- Date: Mon, 17 Oct 2011 14:23:16 -0400
- Subject: Re: [PATCH] sim: dv-cfi: include stdbool.h
- References: <1310410693-20883-1-git-send-email-vapier@gentoo.org> <201110171306.34450.vapier@gentoo.org> <20111017172603.GY19246@adacore.com>
On Monday 17 October 2011 13:26:03 Joel Brobecker wrote:
> > > What we should do is get rid of uses of true and false, and use the
> > > typical zero/nonzero values instead. I think that the blackfin header
> > > and code should be cleaned up accordingly as well.
> >
> > ah, this would make me sad. would a configure check for stdbool.h be
> > acceptable ?
>
> But what would you do if stdbool.h is not available? Wouldn't that
> complicate the code in the end?
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# define bool int
# define true 1
# define false 0
#endif
when reading the code, i find true/false to be more natural than 0/1.
especially when 0/1 return values are not consistent across code bases.
if you really prefer to not have this, i understand. but i find stdbool to be
a useful addition ...
-mike