Skip to content

Build with -Wshadow #899

Description

@Quuxplusone

Consider fixing the few places that -Wshadow warns about. I see at least this one, before I added -Wno-shadow and stopped worrying about it. It would be nice not to have to add -Wno-shadow just for this.

src/tz.cpp: In lambda function:
src/tz.cpp:670:42: error: declaration of 'm' shadows a previous local [-Werror=shadow]
  670 |                  [&s](std::string const& m)
      |                       ~~~~~~~~~~~~~~~~~~~^
src/tz.cpp:669:10: note: shadowed declaration is here
  669 |     auto m = std::find_if(std::begin(month_names), std::end(month_names),
      |          ^

I recall that 3.0.1 had many more instances — something about a bunch of ifstreams named in or is — but I forget the details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions