From 10df93536ee6687730b4df59c3fbfdda8a403755 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 29 Nov 2020 00:01:22 -0800 Subject: [PATCH] Yet another attempt to suppress MSVC C4245 https://github.com/upx/upx/issues/435 modified: pefile.cpp --- src/pefile.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pefile.cpp b/src/pefile.cpp index f3b89147..f60650e3 100644 --- a/src/pefile.cpp +++ b/src/pefile.cpp @@ -3126,8 +3126,15 @@ void PeFile32::pack0(OutputFile *fo, unsigned subsystem_mask, upx_uint64_t default_imagebase, bool last_section_rsrc_only) { +#if defined(_MSVC_LANG) //{ +#pragma warning( push ) +#pragma warning( suppress: 4245 ) +#endif //} super::pack0(fo, ih, oh, subsystem_mask, default_imagebase, last_section_rsrc_only); +#if defined(_MSVC_LANG) //{ +#pragma warning( pop ) +#endif //} } void PeFile32::unpack(OutputFile *fo) @@ -3182,7 +3189,14 @@ void PeFile64::readPeHeader() void PeFile64::pack0(OutputFile *fo, unsigned subsystem_mask, upx_uint64_t default_imagebase) { +#if defined(_MSVC_LANG) //{ +#pragma warning( push ) +#pragma warning( suppress: 4245 ) +#endif //} super::pack0(fo, ih, oh, subsystem_mask, default_imagebase, false); +#if defined(_MSVC_LANG) //{ +#pragma warning( pop ) +#endif //} } void PeFile64::unpack(OutputFile *fo)