jhasse / poly2tri

2D constrained Delaunay triangulation library
BSD 3-Clause "New" or "Revised" License
439 stars 89 forks source link

Fix variable shadowing issue in Point's constructor. Shadowing causes… #15

Closed samr closed 4 years ago

samr commented 4 years ago

… can cause build failures when one's compiler is configured to flag shadowing as an error.

jhasse commented 4 years ago

Which compiler warns here?

samr commented 4 years ago

Both GCC 7.5.0 and Clang 6.0.0 on Linux. We are using the -Werror=shadow flag.

jhasse commented 4 years ago

Might be a better idea to disable that warning using a #pragma. Shadowing is very subjective, I like it and would rather keep on using it when making changes to poly2tri.

samr commented 4 years ago

Interesting. Ok, np. I have a thing against pragmas, personally. I will withdraw request and fix it in other ways. Thanks.

jhasse commented 4 years ago

I meant adding the pragmas to poly2tri though. Would that be better for you?

samr commented 4 years ago

If you want to add the pragmas, go for it. From the perspective of the project I'm working on, we can likely just tweak the compiler flags in cmake for this particular library, or perhaps maintain our own fork that does not have shadowing issues.