This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: typedef char bool;


# Also, asking to turn it off sounds strange; you might just as well ask
# to turn-off 'template', or 'class', or 'while'.

One would've thought that the easiest solution was to remove the typedef,
and allowing the compiler to use the builtin bool type. (And any #define
{true|false} statements, too). It would be somewhat easier than modifying
g++.

Another solution (less preferred) would be to:

typedef char xbool;

#define bool xbool

Thus forcing your routines to use 'xbool', although I'd only do this if
your routines store something other than true or false in bool types. If
they do, you don't want a boolean type at all :-)

I agree with Martin's view that the code is at fault, and not g++:
removing bool is like trying to remove int - you just don't do it (at
least, you shouldn't - the portability implications of this are not to be
sneezed at).

HTH,

-- 
Mo McKinlay                                T: +44 (0) 709 22 55 05  x1
Chief Software Architect                   F: +44 (0) 709 22 55 05  x3
inter/open                                 E: mmckinlay@labs.interopen.org
A division of Bekon Marketing Limited      W: http://www.interopen.org


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