Skip to content

Commit a04ed3c

Browse files
committed
Fix some warnings from GCC-15
1 parent 5ad273c commit a04ed3c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/tinykvm/linux/system_calls.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void Machine::setup_linux_system_calls()
6161
regs.rsi, regs.rdx);
6262

6363
regs.rax = readv(fd, (struct iovec *)&buffers[0], bufcount);
64-
if (regs.rax < 0)
64+
if (int(regs.rax) < 0)
6565
regs.rax = -errno;
6666
cpu.set_registers(regs);
6767
});
@@ -178,7 +178,7 @@ void Machine::setup_linux_system_calls()
178178
fd = cpu.machine().fds().translate(regs.rdi);
179179
}
180180
regs.rax = lseek(fd, regs.rsi, regs.rdx);
181-
if (regs.rax < 0) {
181+
if (int(regs.rax) < 0) {
182182
regs.rax = -errno;
183183
}
184184
} catch (...) {
@@ -464,7 +464,7 @@ void Machine::setup_linux_system_calls()
464464
auto& regs = cpu.registers();
465465
switch (regs.rsi) {
466466
case 0x5401: /* TCGETS */
467-
if (regs.rdi >= 0 && regs.rdi < 3)
467+
if (int(regs.rdi) >= 0 && int(regs.rdi) < 3)
468468
regs.rax = 0;
469469
else
470470
regs.rax = -EPERM;
@@ -725,7 +725,7 @@ void Machine::setup_linux_system_calls()
725725
try {
726726
const int fd = cpu.machine().fds().translate(regs.rdi);
727727
regs.rax = ::shutdown(fd, regs.rsi);
728-
if (regs.rax < 0)
728+
if (int(regs.rax) < 0)
729729
regs.rax = -errno;
730730
} catch (...) {
731731
regs.rax = -EBADF;
@@ -801,7 +801,7 @@ void Machine::setup_linux_system_calls()
801801
auto& regs = cpu.registers();
802802
struct timeval tv;
803803
regs.rax = gettimeofday(&tv, nullptr);
804-
if (regs.rax < 0)
804+
if (int(regs.rax) < 0)
805805
{
806806
regs.rax = -errno;
807807
}
@@ -915,7 +915,7 @@ void Machine::setup_linux_system_calls()
915915
auto& regs = cpu.registers();
916916
struct timespec ts;
917917
regs.rax = clock_gettime(CLOCK_MONOTONIC, &ts);
918-
if (regs.rax < 0)
918+
if (int(regs.rax) < 0)
919919
regs.rax = -errno;
920920
else
921921
cpu.machine().copy_to_guest(regs.rsi, &ts, sizeof(ts));

lib/tinykvm/machine_elf.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ void Machine::elf_loader(std::string_view binary, const MachineOptions& options)
9191
this->m_binary = binary;
9292

9393
const auto* phdr = (Elf64_Phdr*) (binary.data() + elf->e_phoff);
94-
const auto program_begin = phdr->p_vaddr;
9594
this->m_start_address = this->m_image_base + elf->e_entry;
9695
this->m_heap_address = 0x0;
9796

0 commit comments

Comments
 (0)