Skip to content

Commit

Permalink
Update new.cpp
Browse files Browse the repository at this point in the history
Suppress 4 annoying warnings in new.cpp.
  • Loading branch information
jmparatte committed Jun 30, 2024
1 parent 321fca0 commit 0a14a50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cores/arduino/new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 0a14a50

Please sign in to comment.