Remove compiler warnings (incl from third party headers) #2072
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We deprecated all the functions inside interface.c/.h in v18 (or maybe v17), so I've now removed them to remove the warnings associated.
Some warnings are from third party headers so it's not possible to fix them directly ourselves, instead we can suppress the particular warnings we want. Rather than do this around all header files (becomes tedious), I've created some wrapper files which do this and those can be included.
I've now set the
-Werror
compiler flag so any warnings will turn into errors (on gcc/clang at least). This can be contentious as different compiler versions can generate different warnings other than what travis reports so could be annoying. But it will prevent any further warnings being introduced at least.The following warnings are removed from MSVC builds:
c:\users\wesley\documents\nano-node\crypto\blake2\blake2.h(142): warning C4804: '/': unsafe use of type 'bool' in operation
c:\users\wesley\documents\nano-node\nano\core_test\block_store.cpp(1485): warning C4242: 'argument': conversion from 'int' to 'uint16_t', possible loss of data
c:\users\wesley\documents\nano-node\nano\qt_system\entry.cpp(19): warning C4242: 'argument': conversion from 'int' to 'uint16_t', possible loss of data
c:\users\wesley\documents\nano-node\nano\node\portmapping.cpp(85): warning C4242: '=': conversion from 'int' to 'uint16_t', possible loss of data
c:\users\wesley\documents\nano-node\nano\core_test\peer_container.cpp(93): warning C4242: 'argument': conversion from 'int' to 'unsigned short', possible loss of data
c:\qt_new\5.9\msvc2017_64\include\qttest\qtestkeyboard.h(77): warning C4242: 'argument': conversion from 'int' to 'ushort', possible loss of data
Issues on MAC:
floodyberry/ed25519-donna#29 We have modified the ed25519 library source before as it hasn't been updated in a number of years. Used the same solution as found here: floodyberry/ed25519-donna#29