From 052392d97b946aa3df58abbc2873aa875485877b Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sat, 28 Nov 2020 20:23:01 -0800 Subject: [PATCH] Attempt workaround for MSVC C4245 signed/unsigned mismatch in template 'argument' https://github.com/upx/upx/issues/435 modified: pefile.cpp --- src/pefile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pefile.cpp b/src/pefile.cpp index c513135e..ed781b1b 100644 --- a/src/pefile.cpp +++ b/src/pefile.cpp @@ -3110,7 +3110,9 @@ void PeFile32::pack0(OutputFile *fo, unsigned subsystem_mask, upx_uint64_t default_imagebase, bool last_section_rsrc_only) { - super::pack0(fo, ih, oh, subsystem_mask, + // Redundant cast of subsystem_mask tries to workaround + // MSVC complaint C4245 signed/unsigned mismatch + super::pack0(fo, ih, oh, (unsigned)subsystem_mask, default_imagebase, last_section_rsrc_only); }