ACTS-427 Add -Wextra -Wpedantic -Wshadow -Wunused-local-typedefs and throw_assert
I think it would be a good idea to enable -Wextra
, -Wpedantic
, -Wshadow
and -Wunused-local-typedefs
. This can give a lot of useful warnings. I sifted through the code to make it compile without warnings with these flags on.
I encountered several uses of assert()
, which when not compiling with Debug, doesn't do anything. I introduced a macro throw_assert()
which works almost identically but throws an exception on assertion failure.
I think usage of assert for unit testing purpose should be discouraged, if you want a runtime check, you can now use throw_assert()
with this MR. This also throws when not compiling in Debug.
Edited by Paul Gessinger