[PATCHv2] implement -Wold-style-cast

Alp Toker alp at nuanti.com
Tue Nov 26 00:37:34 PST 2013

On 26/11/2013 07:18, Dmitri Gribenko wrote:
> On Mon, Nov 25, 2013 at 11:11 PM, Alp Toker <alp at nuanti.com> wrote:
>> In light of this, and considering also that we don't usually make an effort
>> to produce FixIts for warning-level diagnostics in Sema, the original patch
>> to the parser by Ondřej looks fine to me. Dmitri, is that OK with you?
> Yes, this is fine for me.  Of course, the original patch still needs
> to be updated to silence the warning in case of (void) casts -- is
> this what GCC does?

GCC doesn't warn on (void) casts.

The patch should be fixed to handle these cases too:

(void)x; // no warning
(long)x; // warning

The necessary checks can be done in Parse, but might be slightly easier 
/ future-proof handle them in Sema.


> Dmitri

the browser experts

More information about the cfe-commits mailing list