[Patch] Fix for PR9812

Dmitri Gribenko gribozavr at gmail.com
Fri Jan 10 07:52:05 PST 2014

On Fri, Jan 10, 2014 at 5:30 PM, Erik Verbruggen <erik.verbruggen at me.com> wrote:
> On 07 Jan 2014, at 16:28, Erik Verbruggen <erik.verbruggen at me.com> wrote:
>>> On Sat, Dec 14, 2013 at 5:31 AM, Erik Verbruggen <erik.verbrug... at me.com> wrote:
>>>> This is a fix for PR9812, and I have to say that I don't know what more to
>>>> say in the commit message than "warn about bool instead of _Bool", so
>>>> feedback is welcome! I sometimes run into this, hence the patch.
>>>> Two notes: I have to say that the patch feels a bit intrusive, but I didn't
>>>> find a better way to do this. Also, in MS mode, it will warn about __wchar_t
>>>> v.s. wchar_t. I haven't extensively tested this on Windows, but to me it
>>>> looks like the correct thing. Again, feedback welcome!
>>> Thank you for working on this!  This is a strict improvement for C++,
>>> the issue still remains for C.  In that case, we should do something
>>> like Sema::getPrintingPolicy().  We should not be printing 'bool' in C
>>> unless the said macro exists -- we need tests for both cases.  Will
>>> you fix the C case as well?
>> I can do that. Should I do that in a separate commit, or should I do it in this patch?
> I looked at the C case today, and I'm not sure what should change in the output. Can you enlighten me? Below is an example, and the output I get with rev. 198940.

Ah, I see.  Someone has already fixed the issue with printing types in
general -- I thought we still have that issue.  Please add your
excellent testcase to the patch.

Please clang-format your patch (there are 80-col violations).  Apart
from that, LGTM!


(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/

More information about the cfe-commits mailing list