[cfe-dev] Proposal: -Wshadow-field flag

Ehsan Akhgari ehsan.akhgari at gmail.com
Tue Apr 21 15:08:00 PDT 2015


On Tue, Apr 21, 2015 at 5:41 PM, David Blaikie <dblaikie at gmail.com> wrote:

> FWIW I'd be a bit concerned that this warning, while it might have a good
> false positive rate on a codebase with the particular idioms you've
> described, would have a false positive rate a bit too high for a normal
> diagnostic bar.
>
> Only one way to find out, though.
>

That is a good point.

FWIW, I don't think we should turn this warning on as part of -Wall, maybe
as part of -Wextra?  I'm not at all familiar with what the usual process
for turning on warnings by default looks like, so I would appreciate if
someone can point me in the right direction there.

Cheers,
Ehsan


> On Tue, Apr 21, 2015 at 2:30 PM, Reid Kleckner <rnk at google.com> wrote:
>
>> On Tue, Apr 21, 2015 at 2:01 PM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
>> wrote:
>>
>>> On Mon, Apr 20, 2015 at 5:33 PM, Reid Kleckner <rnk at google.com> wrote:
>>>
>>>> I think this would be a great addition! In general, -Wshadow fires in a
>>>> lot of situations, and I think having more granularity here is helpful for
>>>> users.
>>>>
>>>
>>> Note that -Wshadow doesn't diagnose this specific case, so my proposal
>>> isn't really a subset of -Wshadow.
>>>
>>
>> Right, this sounds like a new and useful warning by itself.
>>
>> I was mostly saying this seems like the right direction. The existing
>> checks under -Wshadow are both too little and too much. Having more checks
>> and more granular flags will help us explore the space.
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>


-- 
Ehsan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150421/f9049fae/attachment.html>


More information about the cfe-dev mailing list