This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to libcpp: Move to the intersection of C90 an C++
Patch committed.
| On May 23, 2005, at 9:33 PM, Gabriel Dos Reis wrote:
| > #define bool unsigned char
Zack suggested not making that #define conditional on __cpluscplus,
e.g. have bool always replaced with "unsigned char" (as it was until
this patch).
However, that breaks in several respects:
(1) gcc/ correctly leaves "bool" to what it means if being compiled
with a C++ compiler. So, there is obvious mismatch here. That
is no good. Both gcc/ and libcpp/ shall have the same meaning
of bool.
(2) when libcpp is included in a C++ programs, it silently changes
meanings of the whole program, depending on the order of
inclusions, leading to (better case) incomprehensible
compile-time error, or (worse case) hard-to-find runtime bugs.
If the GCC developer community really feels that "bool", when GCC is
being compiled with a C++ compiler, shall not mean what it means in
a C++ program, then it shall be renamed to something else e.g. Bool,
Boolean or gccbool or ..., as otherwise the unconditional #define
directly conflicts with our own coding convention.
-- Gaby