This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH]: Activate -Wc++-compat warnings for most C++ keywords


>>>>> "Ian" == Ian Lance Taylor <iant@google.com> writes:

Ian> "Kaveh R. GHAZI" <ghazi@caip.rutgers.edu> writes:
>> Okay, I'll double check and activate "bool" separately if it works.  In
>> your patch you seemed to indicate there was something with "bool" that
>> required further discussion.  I thought it was the same issue:
>> http://gcc.gnu.org/ml/gcc-patches/2008-07/msg00805.html
>> 
>> If not the _Bool conflict, then what was it?

Ian> It was the fact that gcc uses "bool" all over the place, and we
Ian> certainly don't want to change that.  But it may not matter, since it
Ian> is usually a preprocessor macro.

For this feature to really work nicely, I suppose we'd have to have
special cases for some things like "wchar_t" which are (IIUC) typedefs
in C and keywords in C++.  IMO the best result would be that we would
warn about uses that would be invalid in C++ (say, "wchar_t" as a
variable name, assuming that is actually invalid, since I don't know),
but not about the typedef itself (assuming it occurs in a system
header) or uses of wchar_t as a type.

Maybe "bool" could be a especially special case, allowed if we see
"typedef _Bool bool".  Perhaps that is too magical and/or hard to
document.

Tom


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