Page MenuHome

MSVC: Enable variable shadow warnings
AbandonedPublic

Authored by Ray Molenkamp (LazyDodo) on Jul 2 2021, 6:16 PM.

Details

Reviewers
None
Summary

WShadow is on for GCC and MSVC devs sometimes accidentally
add code emitting these warnings, since msvc does not warn
about this by default.

This patch enables the appropriate warnings, but it seems
to emit up quite a few warnings GCC somehow did not notice.

see P2228 for a list.

I don't necessarily need a code review it's more a of dicussion review

  1. Do we want to enable this?
  2. If so, can/should we tweak GCC to be more pro-active in this area

If we decide to land this, we should alteast resolve the outstanding
warnings before doing so.

Diff Detail

Repository
rB Blender
Branch
tmp_variable_shadow (branched from master)
Build Status
Buildable 15566
Build 15566: arc lint + arc unit

Event Timeline

Ray Molenkamp (LazyDodo) requested review of this revision.Jul 2 2021, 6:16 PM
Ray Molenkamp (LazyDodo) created this revision.

I went over the list to see what cases it finds (see D11855).
Overall, I do think that these cases should be fixed and that the warning should be enabled. I wonder if we can easily disable the warning for headers in extern/.

I think it's better to exclude the check for extern, indeed. Otherwise I agree it's a good thing to enable.

Ray Molenkamp (LazyDodo) planned changes to this revision.Feb 1 2022, 4:47 PM

On the back burner, i just lack the time right now for a cleanup this big.

archived to prepare for migration