approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
317 stars 51 forks source link

warning C4459 in MSVC with /W4 #193

Closed rick-de-water closed 2 years ago

rick-de-water commented 2 years ago

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.

claremacrae commented 2 years ago

Thank you. This should be fixed in the next release, later today.