Closed dmlary closed 1 year ago
I can have a look at the C4244 warning
from MSVC
. :slightly_smiling_face:
Can push a change to your branch when I figure out a solution.
Unless you want to figure it out yourself, of course :stuck_out_tongue:
Well great... Seems like some of the stuff I added was not completely supported by all compilers. I'll fix that. Sorry 😛
Seems like the rest is GCC related. Since that's my main compiler anyways I can have a quick look 🙂
Last error seems to be related to [[maybe_unused]]
not being fully implemented for structured bindings in GCC7
.
Ref: https://stackoverflow.com/questions/47005032/structured-bindings-and-range-based-for-supress-unused-warning-in-gcc
oh, nice! Looks like you've knocked out most of it.
The dumb fix for gcc7 is to just use that other variable. I wonder if the old-school cast-to-void ((void)var
) will get us past the hump. Failing that, there's a C++ construct we can use: https://stackoverflow.com/a/3418951
oh, nice! Looks like you've knocked out most of it.
The dumb fix for gcc7 is to just use that other variable. I wonder if the old-school cast-to-void (
(void)var
) will get us past the hump. Failing that, there's a C++ construct we can use: https://stackoverflow.com/a/3418951
Seems like the (void)
cast "hack" does the job. It's not pretty, but honestly it's just to make it shut up when a variable is intentionally unused, and GCC7
has a missing support for a case that should work. Just to make the tests work I think it's okay, though it's very ugly :stuck_out_tongue_closed_eyes:
All tests passes now!
To summarize:
external/gason.hpp
and extras/pocketlzma.hpp
are ignored in these specific files, as they are external libraries. Since PocketLzma
is a library I maintain, I will have a look at that specific issue in that project, but Gason
is not maintained by me, is not supported by Tileson
, and is unlikely to ever change based on its history.tests_main.cpp
in the end, that had the sole purpose of being visual and descriptive, but would produce warnings for unused variables etc. I'll let the changes done pass, but I'll probably move this out to another file with those checks disabled eventually for this purpose.(void)variable
cast for GCC7
due to missing [[maybe_unused]]
for structured bindings. It's not pretty, but it gets the job done.unused variable
related warnings feels more annoying than useful, but at the same time it makes us aware of cases where variables are unintentionally created and unused, which should be most cases in a real world scenario, so I guess it's okay to have it on.Tileson
a potentially more stable library, and it shouldn't produce too much annoying warnings for the users of the library.@dmlary : If you got anything to add, feel free to do so. :slightly_smiling_face:
Everything looks good. My goal is achieved here, and I have nothing more to add.
Great work sorting through all those msvc and gcc errors!
Everything looks good. My goal is achieved here, and I have nothing more to add.
Great work sorting through all those msvc and gcc errors!
Then I guess it ready for a merge! This ended up being a nice cooperation task :smile: Thank you very much for your help, and a great initiative :partying_face:
Add
-Wall -Wextra -Werror
to tileson_tests build target, along with (I think) the eqivalent for MSVC.Include quick fixes for existing tests, which may not be the best solution. Committing this to see what comes out of CI.
fixed #86