From 70f406eb0afaa6756c19a6b20749c99a4e2f337c Mon Sep 17 00:00:00 2001 From: Ivan-Stefanov-513 Date: Sat, 9 Sep 2023 23:15:37 +0300 Subject: [PATCH] Update new.cpp Fix compilation warning on file `new.cpp` about unused argument `tag` in four of the functions by casting the argument to void. --- cores/arduino/new.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index 7ca493169..54d1afdb5 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -57,6 +57,7 @@ void * operator new[](std::size_t size) { } void * operator new(std::size_t size, const std::nothrow_t tag) noexcept { + (void)tag; // unused #if defined(NEW_TERMINATES_ON_FAILURE) // Cannot call throwing operator new as standard suggests, so call // new_helper directly then @@ -66,6 +67,7 @@ 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 { + (void)tag; // unused #if defined(NEW_TERMINATES_ON_FAILURE) // Cannot call throwing operator new[] as standard suggests, so call // malloc directly then @@ -101,9 +103,11 @@ void operator delete[](void * ptr, std::size_t size) noexcept { #endif // __cplusplus >= 201402L void operator delete(void* ptr, const std::nothrow_t& tag) noexcept { + (void)tag; // unused operator delete(ptr); } void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept { + (void)tag; // unused operator delete[](ptr); }