Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced 'int' type with 'intptr_t' type in pointer arithmetic for co… #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

s-t-a-n
Copy link

@s-t-a-n s-t-a-n commented Jan 17, 2021

Compiler yabs about losing precision:

~/Arduino/libraries/MemoryFree/src/MemoryFree.cpp:44:7: error: cast from 'void*' to 'int' loses precision [-fpermissive]

Using intptr_t type (as per C99 I believe) is recommended because it guarantees to hold the size of a pointer.

The Arduino IDE compiles with -fpermisive by default, but continuous integration frameworks like Arduino-CI and Cmake/Makefile type compilation does not.

Tested in Arduino-CI and on an Arduino Mega2560.

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