PaulStoffregen
Well-known member
Here's the prior conversation.
Hmm if it's turned off why am I still seeing those exact warnings sometimes?We tried __attribute__ format printf years ago in beta versions. It was pulled before a release because it's far too pedantic about 32 bit integers.
The main problem is both int and long are both 32 bits. To use this on Teensy 4.x, we need a way to suppress the warnings for things like Serial.printf("%d", (long)number)) and Serial.printf("%ld", (int)number)). If these cases give warnings, I'm not going to put it into the core library headers.
I'm still struggling to understand. Are you suggesting we should turn on this overly pedantic warning for everything inheriting from Print class, and then turn it off only for Serial?
Hmm if it's turned off why am I still seeing those exact warnings sometimes?
Would it not be possible to change the newlib definitions of int32_t/uint32_t to int instead of long?
On double-checking it's a class printf method that forwards to@jmarsh is this when you use one of the system “printf” functions or a Print:: printf function? (That extra space is there because I’m not completely clear on how to turn off those emojis. It looks like “Print:rintf”.) The warnings are still there for the former.
::printf()
. And yes for the love of god, can we turn off the obnoxious auto smiley crap that the forum software inserts. It's a plague that haunts every forum dealing with c++ programming.Print
’s implementation.Print
as a direct or “eventual” ancestor (eg. via Stream
, a superclass of Print
), I use multiple inheritance to extend from that class as well.using MyNewClass::printf;
somewhere in the public section of my class, to help the compiler disambiguate.Print
and you call printf on that.