msvc 14 generates new warnings that occurr in just about every llvm source file

Aaron Ballman aaron at aaronballman.com
Fri Aug 1 07:14:21 PDT 2014


On Fri, Aug 1, 2014 at 10:01 AM, Yaron Keren <yaron.keren at gmail.com> wrote:
> If I understand these warning correctly (they are not documented on MS web
> site yet), they warn about local variable  shadowing some other definition.
> If so, none are good to suppress, to the contrary, these new warnings are
> likely to expose bugs in the current codebase.
>
> Shadow situations cause very confusing bugs. We have long functions in
> clang, for instance Sema::ClassifyName is about 300 lines. If I need to
> modify this function, I glance at its header and see Scope *S. I would
> expect S refer to the input paramater all along the function, rather being
> shadowed by some local variable. I can check with VS goto declaration what
> II refers to but why? I've seen it's an input parameter, right? name
> shadowing is a trap.

Shadowing is generally a trap, but the local and parameter warnings
are going to have a *lot* of false positives due to our naming
conventions. This is especially true for things like loop counters,
etc. I would rather not turn on that chatty of a diagnostic until
we've sanitized the codebase further.

~Aaron



More information about the llvm-commits mailing list