Skip to content

Commit

Permalink
Enable -Wunused-parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Mar 6, 2021
1 parent 7205a93 commit 87af905
Show file tree
Hide file tree
Showing 102 changed files with 1,571 additions and 1,463 deletions.
4 changes: 2 additions & 2 deletions Utilities/BitField.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ struct cf_t<void>
}

template<typename T>
static constexpr auto extract(const T& data) -> decltype(+T())
static constexpr auto extract(const T&) -> decltype(+T())
{
return 0;
}
Expand All @@ -237,7 +237,7 @@ struct ff_t : bf_base<T, N>
using vtype = typename ff_t::vtype;

// Return constant value
static constexpr vtype extract(const type& data)
static constexpr vtype extract(const type&)
{
static_assert((V & ff_t::vmask) == V, "ff_t<> error: V out of bounds");
return V;
Expand Down
8 changes: 4 additions & 4 deletions Utilities/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ fs::file::file(const void* ptr, usz size)
{
}

bool trunc(u64 length) override
bool trunc(u64) override
{
return false;
}
Expand All @@ -1349,7 +1349,7 @@ fs::file::file(const void* ptr, usz size)
return 0;
}

u64 write(const void* buffer, u64 count) override
u64 write(const void*, u64) override
{
return 0;
}
Expand Down Expand Up @@ -1854,7 +1854,7 @@ fs::file fs::make_gather(std::vector<fs::file> files)
return result;
}

bool trunc(u64 length) override
bool trunc(u64) override
{
return false;
}
Expand Down Expand Up @@ -1897,7 +1897,7 @@ fs::file fs::make_gather(std::vector<fs::file> files)
return 0;
}

u64 write(const void* buffer, u64 size) override
u64 write(const void*, u64) override
{
return 0;
}
Expand Down
23 changes: 9 additions & 14 deletions Utilities/JIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ asmjit::Error jit_runtime::_add(void** dst, asmjit::CodeHolder* code) noexcept
return asmjit::kErrorOk;
}

asmjit::Error jit_runtime::_release(void* ptr) noexcept
asmjit::Error jit_runtime::_release(void*) noexcept
{
return asmjit::kErrorOk;
}
Expand Down Expand Up @@ -249,7 +249,7 @@ asmjit::Runtime& asmjit::get_global_runtime()
return asmjit::kErrorOk;
}

asmjit::Error _release(void* ptr) noexcept override
asmjit::Error _release(void*) noexcept override
{
return asmjit::kErrorOk;
}
Expand Down Expand Up @@ -281,6 +281,7 @@ asmjit::Runtime& asmjit::get_global_runtime()
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/FormattedStream.h"
Expand All @@ -294,12 +295,6 @@ asmjit::Runtime& asmjit::get_global_runtime()
#pragma GCC diagnostic pop
#endif

#ifdef _WIN32
#include <Windows.h>
#else
#include <sys/mman.h>
#endif

const bool jit_initialize = []() -> bool
{
llvm::InitializeNativeTarget();
Expand Down Expand Up @@ -439,12 +434,12 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
return this->ptr + olda;
}

u8* allocateCodeSection(uptr size, uint align, uint sec_id, llvm::StringRef sec_name) override
u8* allocateCodeSection(uptr size, uint align, uint /*sec_id*/, llvm::StringRef /*sec_name*/) override
{
return allocate(code_ptr, size, align, utils::protection::wx);
}

u8* allocateDataSection(uptr size, uint align, uint sec_id, llvm::StringRef sec_name, bool is_ro) override
u8* allocateDataSection(uptr size, uint align, uint /*sec_id*/, llvm::StringRef /*sec_name*/, bool /*is_ro*/) override
{
return allocate(data_ptr, size, align, utils::protection::rw);
}
Expand All @@ -454,7 +449,7 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
return false;
}

void registerEHFrames(u8* addr, u64 load_addr, usz size) override
void registerEHFrames(u8*, u64, usz) override
{
}

Expand Down Expand Up @@ -489,12 +484,12 @@ struct MemoryManager2 : llvm::RTDyldMemoryManager
return {addr, llvm::JITSymbolFlags::Exported};
}

u8* allocateCodeSection(uptr size, uint align, uint sec_id, llvm::StringRef sec_name) override
u8* allocateCodeSection(uptr size, uint align, uint /*sec_id*/, llvm::StringRef /*sec_name*/) override
{
return jit_runtime::alloc(size, align, true);
}

u8* allocateDataSection(uptr size, uint align, uint sec_id, llvm::StringRef sec_name, bool is_ro) override
u8* allocateDataSection(uptr size, uint align, uint /*sec_id*/, llvm::StringRef /*sec_name*/, bool /*is_ro*/) override
{
return jit_runtime::alloc(size, align, false);
}
Expand All @@ -504,7 +499,7 @@ struct MemoryManager2 : llvm::RTDyldMemoryManager
return false;
}

void registerEHFrames(u8* addr, u64 load_addr, usz size) override
void registerEHFrames(u8*, u64, usz) override
{
}

Expand Down
2 changes: 2 additions & 0 deletions Utilities/JIT.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <asmjit/asmjit.h>
#pragma GCC diagnostic pop
#endif
Expand Down Expand Up @@ -178,6 +179,7 @@ inline FT build_function_asm(F&& builder)
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wsuggest-override"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#ifdef __clang__
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
#endif
Expand Down
2 changes: 1 addition & 1 deletion Utilities/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ const bool s_exception_handler_set = []() -> bool

#else

static void signal_handler(int sig, siginfo_t* info, void* uct) noexcept
static void signal_handler(int /*sig*/, siginfo_t* info, void* uct) noexcept
{
x64_context* context = static_cast<ucontext_t*>(uct);

Expand Down
2 changes: 1 addition & 1 deletion Utilities/lockless.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class lf_queue final
}

template <atomic_wait::op Flags = atomic_wait::op::eq>
void wait(std::nullptr_t null = nullptr) noexcept
void wait(std::nullptr_t /*null*/ = nullptr) noexcept
{
if (m_head == nullptr)
{
Expand Down

0 comments on commit 87af905

Please sign in to comment.