summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-12-19 11:12:20 -0800
committerMark Rowe <mark@vector35.com>2025-12-20 21:34:49 -0800
commited0f3b1b8593f6b76fbb64c53a0885073c1c1979 (patch)
tree5d22d77ccea8bffc0619a32ed886d79d14daccf1 /arch/mips
parentba13f6ec7d0ce9a18a03a1c895fb72d18e03014a (diff)
Fix many of the warnings that show up when compiling with GCC 15.2
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/arch_mips.cpp3
-rw-r--r--arch/mips/il.cpp2
-rw-r--r--arch/mips/mips/mips.c3
-rw-r--r--arch/mips/mips/test.c13
4 files changed, 12 insertions, 9 deletions
diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp
index 0853f9fb..83d7a98d 100644
--- a/arch/mips/arch_mips.cpp
+++ b/arch/mips/arch_mips.cpp
@@ -811,6 +811,7 @@ public:
if (operation_name == NULL)
return false;
strncpy(operation, operation_name, sizeof(operation));
+ operation[sizeof(operation) - 1] = '\0';
if (instr.operands[0].operandClass == V_DEST)
{
@@ -3574,7 +3575,7 @@ public:
break;
default:
result[i].type = UnhandledRelocation;
- LogWarn("Unsupported relocation type: %llu (%s) @0x%llX", result[i].nativeType,
+ LogWarn("Unsupported relocation type: %" PRIu64 " (%s) @0x%" PRIx64, result[i].nativeType,
GetRelocationString((ElfMipsRelocationType)result[i].nativeType), result[i].address);
}
}
diff --git a/arch/mips/il.cpp b/arch/mips/il.cpp
index 5700acbc..1d10d9dd 100644
--- a/arch/mips/il.cpp
+++ b/arch/mips/il.cpp
@@ -3176,7 +3176,7 @@ bool GetLowLevelILForInstruction(Architecture* arch, uint64_t addr, LowLevelILFu
case MIPS_LDC2:
case MIPS_LDC3:
{
- unsigned cop;
+ unsigned cop = 0;
switch (instr.operation)
{
case MIPS_LDC1: cop = 1; break;
diff --git a/arch/mips/mips/mips.c b/arch/mips/mips/mips.c
index ee323f9d..37c56513 100644
--- a/arch/mips/mips/mips.c
+++ b/arch/mips/mips/mips.c
@@ -3580,6 +3580,7 @@ uint32_t mips_disassemble(
const char* reg = NULL;
strncpy(operation, OperationStrings[instruction->operation], sizeof(operation));
+ operation[sizeof(operation) - 1] = '\0';
if (instruction->operands[0].operandClass == V_DEST)
{
char* p = dest;
@@ -3744,7 +3745,7 @@ uint32_t mips_decompose(
const uint32_t* instructionValue,
size_t size,
Instruction* restrict instruction,
- uint32_t version,
+ MipsVersion version,
uint64_t address,
uint32_t endianBig,
uint32_t flags)
diff --git a/arch/mips/mips/test.c b/arch/mips/mips/test.c
index 339126e0..00034142 100644
--- a/arch/mips/mips/test.c
+++ b/arch/mips/mips/test.c
@@ -110,11 +110,11 @@ int main(int ac, char **av)
baseaddr = 0;
if (0 == disassemble(insword, baseaddr, version, flags, instxt))
{
- printf("%08llX: %08X %s\n", baseaddr, insword, instxt);
+ printf("%08" PRIX64 ": %08X %s\n", baseaddr, insword, instxt);
}
else
{
- printf("%08llX: %08X ??\n", baseaddr, insword);
+ printf("%08" PRIX64 ": %08X ??\n", baseaddr, insword);
}
// disassemble(0x14E00003, 0, version, flags, instxt);
if (version < MIPS_32)
@@ -124,11 +124,11 @@ int main(int ac, char **av)
baseaddr = 0x405a58;
if (0 == disassemble(insword, baseaddr, version, flags, instxt))
{
- printf("%08llX: %08X %s\n", baseaddr, insword, instxt);
+ printf("%08" PRIX64 ": %08X %s\n", baseaddr, insword, instxt);
}
else
{
- printf("%08llX: %08X ??\n", baseaddr, insword);
+ printf("%08" PRIX64 ": %08X ??\n", baseaddr, insword);
}
// disassemble(0x14E00003, 4, version, flags, instxt);
if (version < MIPS_32)
@@ -186,11 +186,11 @@ int main(int ac, char **av)
#endif
if (0 == disassemble(insword, baseaddr, version, flags, instxt))
{
- printf("%08llX: %08X %s\n", baseaddr, insword, instxt);
+ printf("%08" PRIX64 ": %08X %s\n", baseaddr, insword, instxt);
}
else
{
- printf("%08llX: %08X ??\n", baseaddr, insword);
+ printf("%08" PRIX64 ": %08X ??\n", baseaddr, insword);
}
baseaddr += 4;
p += 8;
@@ -202,3 +202,4 @@ int main(int ac, char **av)
cleanup:
return result;
}
+