This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: FYI: avoid use of C++ keywords in gcc/java
>>>>> "Kaveh" == Kaveh R GHAZI <ghazi@caip.rutgers.edu> writes:
Tom> I tried this on the compile farm but the build dies in libgomp. This
Tom> is a bug in the patch, not libgomp, as the failing keyword is _Bool.
Tom> This is tricky to fix since both 'bool' and '_Bool' map to RID_BOOL.
Kaveh> Hmm. What I don't understand is why this warning is active in
Kaveh> a target library in the first place. I put -Wc++-compat in
Kaveh> only for the gcc dir. Are you sure when you added the C++
Kaveh> keyword warning that it checks warn_cxx_compat? Seems like the
Kaveh> only way it would complain in this dir is if it's on always.
Yeah, the warn_cxx_compat check is done when the keywords are added.
However, it always adds the _Bool keyword. The "should I warn" logic
checks the RID_* value to see if it is a C++ keyword -- but because
_Bool and bool share a RID code, the warning triggers.
One way to fix this would be to add a new RID code to differentiate
the two cases. Another way would be to check the spelling of the
token at the warning point.
Tom