Fix build with latest visual studio (2019) #386
Merged
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.
When compiling release/1.2.0 with latest Visual Studio (2019), there were 2 new error-messages which resulted in a failed build:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\vcruntime.h(255): error C2220: warning treated as error - no 'object' file generated
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\vcruntime.h(255): warning C4668: '__cplusplus' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\vcruntime.h(258): warning C4668: '__cplusplus' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX64\x64\cl.EXE"' : return code '0x2'
S
.....
C:\Users\jan.nijtmans\workspace\libtommath\bn_deprecated.c(12) : error C2220: warning treated as error - no 'object' file generated
C:\Users\jan.nijtmans\workspace\libtommath\bn_deprecated.c(12) : warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
C:\Users\jan.nijtmans\workspace\libtommath\bn_deprecated.c(9) : note: index 'b' range checked by comparison on this line
C:\Users\jan.nijtmans\workspace\libtommath\bn_deprecated.c(12) : note: feeds call on this line
C
....
Clearly those are errors in visual studio :-(