From c7a0e9dc43bbec4f09292016cd5ae80ac87e9d9d Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Mon, 9 May 2022 19:16:28 +0100 Subject: [PATCH] Prevent unused parameter warnings --- cores/arduino/new.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index 7ca493169..58e62370b 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -57,6 +57,8 @@ void * operator new[](std::size_t size) { } void * operator new(std::size_t size, const std::nothrow_t tag) noexcept { + // Prevent an 'unused parameter' warning + static_cast(tag); #if defined(NEW_TERMINATES_ON_FAILURE) // Cannot call throwing operator new as standard suggests, so call // new_helper directly then @@ -66,6 +68,8 @@ void * operator new(std::size_t size, const std::nothrow_t tag) noexcept { #endif } void * operator new[](std::size_t size, const std::nothrow_t& tag) noexcept { + // Prevent an 'unused parameter' warning + static_cast(tag); #if defined(NEW_TERMINATES_ON_FAILURE) // Cannot call throwing operator new[] as standard suggests, so call // malloc directly then @@ -101,9 +105,13 @@ void operator delete[](void * ptr, std::size_t size) noexcept { #endif // __cplusplus >= 201402L void operator delete(void* ptr, const std::nothrow_t& tag) noexcept { + // Prevent an 'unused parameter' warning + static_cast(tag); operator delete(ptr); } void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept { + // Prevent an 'unused parameter' warning + static_cast(tag); operator delete[](ptr); }