Skip to content

warning C4459 in MSVC with /W4 #193

Closed
@rick-de-water

Description

@rick-de-water

The following warning gets emitted a lot when building using Visual studio 2022 and warning level 4.

ApprovalTests.hpp(4954, 77) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(4961, 40) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(4968, 21) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(4977, 21) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(5104, 30) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(6163, 51) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(6171, 48) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(6366, 28) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(6375, 70) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(6416, 62) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]
ApprovalTests.hpp(6769, 42) : warning C4459 : declaration of 'path' hides global declaration
  ApprovalTests.hpp(4495, 10) : message: see declaration of 'ApprovalTests::path'[xxx.vcxproj]

I manually changed the name for now but it should probably have a unique name in a future release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions