Closed
Description
Sample code:
#include <Ticker.h>
void testFn(unsigned char i) {}
void setup() {
Ticker t;
unsigned char i = 1;
t.once_ms(100, testFn, i);
}
I get this warning when compiling the latest git version:
libraries/Ticker/Ticker.h: In instantiation of 'void Ticker::once_ms(uint32_t, void (*)(TArg), TArg) [with TArg = unsigned char; uint32_t = unsigned int]':
libraries/Ticker/Ticker.h:110:94: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
_attach_ms(milliseconds, false, reinterpret_cast<callback_with_arg_t>(callback), (void*)arg);
It originates from this line of code (changed in commit 7910121):
Arduino/libraries/Ticker/Ticker.h
Line 110 in 48ace77
It seems that it's caused by the
(void*)
cast in the last parameter.