ArduinoThread icon indicating copy to clipboard operation
ArduinoThread copied to clipboard

Use uintptr_t type for ThreadID

Open hlovdal opened this issue 5 years ago • 0 comments

For Arduino target code there is no difference between int and pointer sizes but it matters when compiling the code for unit test on a 64bit linux host computer:

.../arduino/sketchbook/libraries/ArduinoThread/Thread.cpp: In constructor ‘Thread::Thread(void (*)(), long unsigned int)’:
.../arduino/sketchbook/libraries/ArduinoThread/Thread.cpp:9:18: error: cast from ‘Thread*’ to ‘int’ loses precision [-fpermissive]
  ThreadID = (int)this;
                  ^~~~

hlovdal avatar Feb 17 '19 17:02 hlovdal