This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] sim: dv-cfi: include stdbool.h


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]