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


>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

>> #ifdef HAVE_STDBOOL_H
>> # include <stdbool.h>
>> #else
>> # define bool int
>> # define true 1
>> # define false 0
>> #endif

Joel> I don't know what the others feel about this, I'm always wary of
Joel> this, but maybe I'm too paranoid. I remember using these sorts of
Joel> defines, and getting into portability issues, but that was a very
Joel> long time ago, and I don't remember the details. Perhaps I didn't
Joel> do something right, or it's now OBE.

GCC has done this for years and years.
I think it has been a net positive for code readability.

Joel> I think that the best compromise, if you really want to "true" and/or
Joel> "false", is to probably start using gnulib in the sim code as well.
Joel> I just don't know offhand how easy it would be to integrate that
Joel> with GDB's use of gnulib. But it'd allow you to include stdbool.h
Joel> unconditionally, knowing that gnulib would provide it if the system
Joel> doesn't already.

It could perhaps be put in libiberty more easily.

Tom


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