Skip to content

Commit dca9224

Browse files
committed
Fix compiler warnings seen with Clang 21
1 parent 5a99579 commit dca9224

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

arch/armv7/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if(BN_INTERNAL_BUILD)
4444
RUNTIME_OUTPUT_DIRECTORY ${BN_CORE_PLUGIN_DIR})
4545
endif()
4646

47-
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
47+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
4848
target_compile_options(arch_armv7 PRIVATE
4949
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
5050
)

arch/armv7/arch_armv7.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -884,12 +884,10 @@ class Armv7Architecture: public ArmCommonArchitecture
884884
const InstructionOperand& op,
885885
vector<InstructionTextToken>& result)
886886
{
887-
const char* reg = NULL;
888-
reg = GetRegisterName((enum Register)op.reg).c_str();
889-
if (reg == NULL)
887+
auto reg = GetRegisterName((enum Register)op.reg);
888+
if (reg.empty())
890889
return FAILED_TO_DISASSEMBLE_REGISTER;
891890

892-
893891
result.emplace_back(RegisterToken, reg);
894892
tokenize_shift(op, result);
895893
return DISASM_SUCCESS;

demangler/gnu3/demangle_gnu3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ DemangledTypeNode DemangleGNU3::DemangleFunction(bool cnst, bool vltl)
471471
old_isparam = m_isParameter;
472472
m_isParameter = true;
473473
m_functionSubstitute.push_back({});
474-
int i = 0;
474+
[[maybe_unused]] int i = 0;
475475
while (m_reader.Peek() != 'E')
476476
{
477477
DemangledTypeNode param = DemangleType();

0 commit comments

Comments
 (0)