Skip to content

Commit c8ae3ff

Browse files
authored
Merge pull request #2320 from mazunki/fix-silence-unused-parameters
Silence unused warnings
2 parents 5efec4a + 90e5410 commit c8ae3ff

File tree

19 files changed

+35
-26
lines changed

19 files changed

+35
-26
lines changed

deps/lest/default.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}:
55
stdenv.mkDerivation rec {
66
pname = "lest";
7-
version = "1.35.2";
7+
version = "1.36.0";
88

99
meta = {
1010
description = "A tiny C++11 test framework – lest errors escape testing.";
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec {
1414

1515
src = fetchGit {
1616
url = "https://github.com/martinmoene/lest.git";
17-
rev = "1eda2f7c33941617fc368ce764b5fbeffccb59bc";
17+
ref = "refs/tags/v${version}";
18+
rev = "57197f32f2c7d3f3d3664a9010d3ff181a40f6ca";
1819
};
1920

2021
cmakeBuildType = "Debug";

lib/LiveUpdate/src/update.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,14 @@ void LiveUpdate::exec(const buffer_t& blob, void* location)
248248
#ifdef PLATFORM_x86_solo5
249249
solo5_exec(blob.data(), blob.size());
250250
throw std::runtime_error("solo5_exec returned");
251+
(void) found_kernel_start;
251252
# elif defined(PLATFORM_UNITTEST)
252253
throw liveupdate_exec_success();
254+
(void) found_kernel_start;
253255
# elif defined(USERSPACE_KERNEL)
254256
hotswap(phys_base, bin_data, bin_len, (void*) (uintptr_t) start_offset, sr_data);
255257
throw liveupdate_exec_success();
258+
(void) found_kernel_start;
256259
# elif defined(ARCH_x86_64)
257260
// change to simple pagetable
258261
__x86_init_paging((void*) 0x1000);
@@ -270,6 +273,8 @@ void LiveUpdate::exec(const buffer_t& blob, void* location)
270273
((decltype(&hotswap64)) HOTSWAP_AREA)(phys_base, bin_data, bin_len, start_offset, sr_data, nullptr);
271274
}
272275
}
276+
#else
277+
(void) found_kernel_start;
273278
# endif
274279
// copy hotswapping function to sweet spot
275280
memcpy(HOTSWAP_AREA, (void*) &hotswap, &__hotswap_length - (char*) &hotswap);

src/arch/i686/paging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void __arch_init_paging()
2828
namespace os {
2929
namespace mem {
3030
__attribute__((weak))
31-
Map map(Map m, const char* name) {
31+
Map map(Map m, const char* name) { // FIXME: use params, remove or mark unused
3232
return {};
3333
}
3434

src/crt/c_abi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int __vsprintf_chk(char* s, int flag, size_t slen, const char* format, va_list a
108108
__assert ((size_t) res < slen);
109109
return res;
110110
}
111-
int __vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
111+
int __vsnprintf_chk (char *s, [[maybe_unused]] size_t maxlen, int flags, size_t slen,
112112
const char *format, va_list args)
113113
{
114114
assert (slen < maxlen);

src/drivers/vmxnet3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ vmxnet3::vmxnet3(hw::PCI_Device& d, const uint16_t mtu) :
178178
assert(this->ptbase);
179179

180180
// verify and select version
181-
bool ok = check_version();
181+
[[maybe_unused]] bool ok = check_version();
182182
assert(ok);
183183

184184
// reset device

src/hw/ps2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ namespace hw
217217

218218
// self-test (port1)
219219
write_port1(0xFF);
220-
const uint8_t selftest = read_data();
220+
[[maybe_unused]] const uint8_t selftest = read_data();
221221
assert(selftest == 0xAA && "PS/2 controller self-test");
222222

223223
write_port1(DEV_IDENTIFY);

src/kernel/events.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
//#define DEBUG_SMP
2525

2626
static SMP::Array<Events> managers;
27+
#ifdef INCLUDEOS_SMP_ENABLE
2728
static Spinlock em_lock_;
29+
#endif
2830

2931
Events& Events::get(int cpuid)
3032
{
@@ -39,7 +41,7 @@ Events& Events::get(int cpuid)
3941
Events& Events::get()
4042
{
4143
#ifdef INCLUDEOS_SMP_ENABLE
42-
static Spinlock lock;
44+
static Spinlock lock; // FIXME: this seems unused.
4345
std::lock_guard<Spinlock> guard(em_lock_);
4446
#endif
4547
return PER_CPU(managers);

src/kernel/liveupdate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void kernel::setup_liveupdate()
2020
kernel::state().liveupdate_loc = kernel::state().liveupdate_phys;
2121
#endif
2222

23-
const size_t size = kernel::state().liveupdate_size;
23+
[[maybe_unused]] const size_t size = kernel::state().liveupdate_size;
2424
PRATTLE("Setting up LiveUpdate from %p to %p, %zx\n",
2525
(void*) kernel::state().liveupdate_phys,
2626
(void*) kernel::state().liveupdate_loc, size);

src/musl/getrandom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "common.hpp"
22
#include <kernel/rng.hpp>
33

4-
// TODO Flags are ignored.
4+
// TODO: flags are ignored.
55
static long sys_getrandom(void* buf, size_t len, unsigned int flags)
66
{
77
rng_absorb(buf, len);

src/net/dhcp/dh4client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace net {
4242
{
4343
// default timed out handler spams logs
4444
this->on_config(
45-
[this] (bool timed_out)
45+
[&] (bool timed_out)
4646
{
4747
if (timed_out)
4848
MYINFO("Negotiation timed out (%s)", this->stack.ifname().c_str());

0 commit comments

Comments
 (0)