Skip to content

Commit

Permalink
Fix warning about negative shifts. (#2171)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 authored Sep 24, 2023
1 parent a088a5e commit 1fc1011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ project(capstone
if (MSVC)
add_compile_options(/W1 /w14189)
else()
add_compile_options(-Werror -Wreturn-type -Wformat -Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context -Wmisleading-indentation)
add_compile_options(-Werror -Wshift-negative-value -Wreturn-type -Wformat -Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context -Wmisleading-indentation)
endif()


Expand Down
4 changes: 2 additions & 2 deletions arch/ARM/ARMInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ DEFINE_printAddrMode5Operand(false) DEFINE_printAddrMode5Operand(true)
printRegName(O, MCOperand_getReg(MO1));
if (MCOperand_getImm(MO2)) {
SStream_concat(O, "%s", ":");
printInt64(O, ((int32_t)MCOperand_getImm(MO2)) << 3);
printInt64(O, ((uint32_t)MCOperand_getImm(MO2)) << 3);
}
SStream_concat(O, "%s", "]");
SStream_concat0(O, markup(">"));
Expand Down Expand Up @@ -1177,7 +1177,7 @@ void printPCLabel(MCInst *MI, unsigned OpNum, SStream *O)
return; \
} \
\
int32_t OffImm = (int32_t)MCOperand_getImm(MO) << scale; \
int32_t OffImm = (uint32_t)MCOperand_getImm(MO) << scale; \
\
SStream_concat0(O, markup("<imm:")); \
if (OffImm == INT32_MIN) \
Expand Down

0 comments on commit 1fc1011

Please sign in to comment.