Skip to content

Conversation

@hlovdal
Copy link

@hlovdal hlovdal commented Feb 17, 2019

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;
                  ^~~~

For Arduino target code there is no difference between int and pointer sizes, e.g.
$HOME/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino4/avr/include/stdint.h
   typedef uint16_t uintptr_t;

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;
                  ^~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant