[SOLVED] Strange error message when sketch uploaded first time

When I upload any type of sketch first time after starting IDE to Arduino board (either Uno (clone) or Nano Every (original)) I get following error message:

C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp: In function 'void* operator new(std::size_t, std::nothrow_t)':
C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp:59:60: warning: unused parameter 'tag' [-Wunused-parameter]
 void * operator new(std::size_t size, const std::nothrow_t tag) noexcept {
                                                            ^~~
C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp: In function 'void* operator new [](std::size_t, const std::nothrow_t&)':
C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp:68:63: warning: unused parameter 'tag' [-Wunused-parameter]
 void * operator new[](std::size_t size, const std::nothrow_t& tag) noexcept {
                                                               ^~~
C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp: In function 'void operator delete(void*, const std::nothrow_t&)':
C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp:103:55: warning: unused parameter 'tag' [-Wunused-parameter]
 void operator delete(void* ptr, const std::nothrow_t& tag) noexcept {
                                                       ^~~
C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp: In function 'void operator delete [](void*, const std::nothrow_t&)':
C:\Users\Sebastian_2\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.5\cores\arduino\new.cpp:106:57: warning: unused parameter 'tag' [-Wunused-parameter]
 void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept {
                                                         ^~~
Der Sketch verwendet 4354 Bytes (13%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 482 Bytes (23%) des dynamischen Speichers, 1566 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.

The error message

  • is pretty much independent from the sketch being uploaded

  • does not show up when the sketch is uploaded a second time (or third, fourth, ...)

So, doesn't look harmful but it shows up now for quite a while - while it was not showing up a long time before (and I have no idea what has changed). So it is annoying ...

Any idea on how to get rid of it? Or is it a known bug?

Regards
Sebastian

It is a known issue.

Thanks for quick reply :slightly_smiling_face:

Even though I have a lack in understanding on what is said on github or even being far away on how to install the proposed patch (or of this in [[gnu::unused]] #456) - so I think I will take it as is (or have to)

The reason for this behavior is that, unlike your sketch code, the Arduino IDE caches the core the first time you compile it, and will only recompile it if the core has been modified or the board selection is changed. This caching, which is done for efficiency, has the side effect of causing compiler warning messages for problems in the core and library code to only be shown on that first compilation.

There is a proposal to cache the warning messages so that they can be printed even during compilations that don't compile the cached files:

Thanks for detailed explanation (and apologize for my late response)

Regards
Sebastian