From 37d6a34e5867b288bf1cc27616ca479272fb13f4 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 23 Sep 2018 20:45:07 -0700 Subject: [PATCH] MSVC is a nimrod. (All verions 10.0 through 14.1) "(4074): error C4146: unary minus operator applied to unsigned type, result still unsigned" So what? Many programmers are much better than the typical Microsoft coder. The C standard GUARANTEES that unsigned arithmetic uses two's complement, ignores overflow, and the result is what the hardware adder produces. modified: p_lx_elf.cpp --- src/p_lx_elf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index 47716856..92834fd1 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -4071,7 +4071,7 @@ void PackLinuxElf64::unpack(OutputFile *fo) set_te64(&sym->st_value, symval - asl_delta); } if (Elf64_Sym::SHN_ABS == symsec && xct_off <= symval) { - adjABS(sym, -asl_delta); + adjABS(sym, 0u - asl_delta); } } }