[PATCH] MS ABI: Diagnose unspecified inheritance model ptrs in the best case

Nico Weber thakis at chromium.org
Thu Jul 24 13:00:51 PDT 2014


>
> I think the usual guidance for warnings is "useful enough to be on by
>>> default, or don't have it". Since this is warning is more about optimizable
>>> code and not about correctness, I think this is ok in this case.
>>>
>>
> The idea is similar to -Wpadded, that diagnostic does not presume to
> answer how to minimize the padding in your struct.  Likewise, there are
> many ways to silence this diagnostic depending on the TU:
> 1. Move the definition above the point where in the inheritance model is
> selected.
> 2. Use an inheritance keyword like __single_inheritance.
> 3. Use #pragma pointers_to_members to select an inheritance model.
> 4. Use the /vmg and /vm{s,m,v} flags
>

I thought that padding is a more widely known thing than inheritance model
warnings (and it's also a warning that's shared with gcc, so it has some
documentation :-) ), so I thought giving more guidance would be appropriate.

I then conducted a study on a sample population of experienced Windows
developers (sample size 1), and 100% of the sample population understood
what the warning was about and could think of mitigations 1 and 2. So I
think this is fine, lgtm.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140724/7d2f8856/attachment.html>


More information about the cfe-commits mailing list