Opened 6 years ago

Closed 6 years ago

#857 closed defect (fixed)

warning C4458: on appveyor CI

Reported by: cvvergara Owned by: strk
Priority: major Milestone: 3.8.0
Component: Core Version: 3.6.2
Severity: Annoyance Keywords:
Cc:

Description

appveyor CI has a lot of warning C4458: declaration of 'variable' hides class member

https://ci.appveyor.com/project/OSGeo/geos/build/1.0.163/job/8k603r2543l88lsj#L191

C:\projects\geos\include\geos/algorithm/distance/DiscreteHausdorffDistance.h(224): warning C4458: declaration of 'g0' hides class member (compiling source file C:\projects\geos\src\algorithm\distance\DiscreteHausdorffDistance.cpp) [C:\projects\geos\src\geos.vcxproj]
  C:\projects\geos\include\geos/algorithm/distance/DiscreteHausdorffDistance.h(235): note: see declaration of 'geos::algorithm::distance::DiscreteHausdorffDistance::g0' (compiling source file C:\projects\geos\src\algorithm\distance\DiscreteHausdorffDistance.cpp)
C:\projects\geos\include\geos/algorithm/distance/DiscreteHausdorffDistance.h(225): warning C4458: declaration of 'g1' hides class member (compiling source file C:\projects\geos\src\algorithm\distance\DiscreteHausdorffDistance.cpp) [C:\projects\geos\src\geos.vcxproj]
  C:\projects\geos\include\geos/algorithm/distance/DiscreteHausdorffDistance.h(237): note: see declaration of 'geos::algorithm::distance::DiscreteHausdorffDistance::g1' (compiling source file C:\projects\geos\src\algorithm\distance\DiscreteHausdorffDistance.cpp)
C:\projects\geos\src\algorithm\distance\DiscreteHausdorffDistance.cpp(90): warning C4458: declaration of 'ptDist' hides class member [C:\projects\geos\src\geos.vcxproj]
  C:\projects\geos\include\geos/algorithm/distance/DiscreteHausdorffDistance.h(239): note: see declaration of 'geos::algorithm::distance::DiscreteHausdorffDistance::ptDist' (compiling source file C:\projects\geos\src\algorithm\distance\DiscreteHausdorffDistance.cpp)
}}

Change History (3)

comment:1 by strk, 6 years ago

Those names come straight from JTS usually. Maybe in Java it's not considered problematic. In other cases we sligthly changed the name of a parameter or internal variable so it would be ok to do it in this case too. There's no standard policy about which part to rename and how IIRC, could be worth setting a note somewhere (on the wiki?) about such policy ( Code style document ? )

comment:2 by robe, 6 years ago

Milestone: 3.7.03.8.0

comment:3 by cvvergara <vicky@…>, 6 years ago

Resolution: fixed
Status: newclosed

In e7adbc5/git:

fix shadow problems (Closes #857)

adding -Wshadow to compilation (on cmake)
This is a combination of 16 commits.

Note: See TracTickets for help on using tickets.