Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.