p-ranav / tabulate

Table Maker for Modern C++
MIT License
1.94k stars 138 forks source link

Hitting some compilation errors (shadow variable, implicit cast) #99

Open austinkinross opened 1 year ago

austinkinross commented 1 year ago

Hey, great project! FYI I'm hitting these errors when I try to compile it in our project, that has fairly strict MSVC warnings enabled:

tabulate\single_include\tabulate\tabulate.hpp(6005,40): error C2220: the following warning is treated as an error tabulate\single_include\tabulate\tabulate.hpp(6005,40): warning C4800: Implicit conversion from 'int' to bool. Possible information loss tabulate\single_include\tabulate\tabulate.hpp(6005,40): message : consider using explicit cast or comparison to 0 to avoid this warning tabulate\single_include\tabulate\tabulate.hpp(8423,34): warning C4456: declaration of 'word_wrapped_text' hides previous local declaration tabulate\single_include\tabulate\tabulate.hpp(8393,8): message : see declaration of 'word_wrapped_text'

I'm using top-of-tree master.

cubicool commented 1 year ago

Also seeing this. A patch like the one I've attached will make it compile, but these changes are by no means the "right" approach; the numeric sign issues are legit, potential problems.

tabulate.patch