Is there an equivalent of gcc's -Wshadow in visual C++

后端 未结 5 1864
被撕碎了的回忆
被撕碎了的回忆 2020-12-17 09:50

-Wshadow will \"Warn whenever a local variable shadows another local variable.\". Is there an equivalent in Visual C++ (2008)? I tried /W4 but it didn\'t pick up on it. I al

5条回答
  •  隐瞒了意图╮
    2020-12-17 10:20

    (I would add this as a comment to Dawn's answer, but have insufficient reputation at the moment)

    There is an issue open on Microsoft Connect petitioning to have the warning upgraded from Code Analysis to standard compilation. I suggest upvoting it to try to get Microsoft's attention.

提交回复
热议问题