This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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 RFA] More stdbool.h fallout


On Fri, Feb 01, 2002 at 11:03:56PM -0800, Ian Lance Taylor wrote:
> I personally have never cared for the fact that bfd.h defines such
> commonly used terms as true, false, and boolean.  That was a mistake
> made in the early days of BFD (or perhaps the mistake was that C did
> not include such common concepts).  But it would certainly be a pain
> to change bfd.h now.
> 
> 
> One approach that would not solve the problem, but might finesse the
> particular issues arising at the moment, would be to, instead of
> having bfd.h define true and false as enum constants, to instead use
> #define.  This could be done on the argument that bfd.h should mimic
> stdbool.h.  It would dodge the problem of including both bfd.h and
> stdbool.h, as it is permissible to #define a name to the same value
> more than once.
> 
> That is:

Actually, I was just thinking about this problem again.  What I would
propose doing is:

 - revert my patch for now, and replace it with a less intrusive patch
which checks for the presence of <stdbool.h> (via
__bool_true_false_are_defined, or via #ifdef true, or whatever...), and
require that <stdbool.h> be included before "bfd.h" if both are to be
included.  Fixing the callers in src/ should be pretty simple.

 - After 2.12, switch globally to bfd_boolean to reduce our namespace
pollution.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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