Skip to content

Commit 1cf2fd1

Browse files
guilhermgonzagamatthijskooijman
authored andcommitted
Mark unused parameters with [[gnu::unused]]
1 parent bc792a9 commit 1cf2fd1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: cores/arduino/new.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void * operator new[](std::size_t size) {
5656
return operator new(size);
5757
}
5858

59-
void * operator new(std::size_t size, const std::nothrow_t tag) noexcept {
59+
void * operator new(std::size_t size, [[gnu::unused]] const std::nothrow_t tag) noexcept {
6060
#if defined(NEW_TERMINATES_ON_FAILURE)
6161
// Cannot call throwing operator new as standard suggests, so call
6262
// new_helper directly then
@@ -65,7 +65,7 @@ void * operator new(std::size_t size, const std::nothrow_t tag) noexcept {
6565
return operator new(size);
6666
#endif
6767
}
68-
void * operator new[](std::size_t size, const std::nothrow_t& tag) noexcept {
68+
void * operator new[](std::size_t size, [[gnu::unused]] const std::nothrow_t& tag) noexcept {
6969
#if defined(NEW_TERMINATES_ON_FAILURE)
7070
// Cannot call throwing operator new[] as standard suggests, so call
7171
// malloc directly then
@@ -100,10 +100,10 @@ void operator delete[](void * ptr, std::size_t size) noexcept {
100100
}
101101
#endif // __cplusplus >= 201402L
102102

103-
void operator delete(void* ptr, const std::nothrow_t& tag) noexcept {
103+
void operator delete(void* ptr, [[gnu::unused]] const std::nothrow_t& tag) noexcept {
104104
operator delete(ptr);
105105
}
106-
void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept {
106+
void operator delete[](void* ptr, [[gnu::unused]] const std::nothrow_t& tag) noexcept {
107107
operator delete[](ptr);
108108
}
109109

0 commit comments

Comments
 (0)