Skip to content

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.

EDIT: I accidentally opened a pull request for this repo whilst I meant to open it for McNeights. Close it if you like. Pull it if you want.

McNeight and others added 5 commits March 20, 2015 15:28


Added vim related entries to .gitignore from https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
Verfied code against Arduino 1.6.1 running on Arduino Leonardo
This causes a compiler warning.
Remove semicolon from #include "MemoryFree.h";
@s-t-a-n s-t-a-n closed this Jan 17, 2021
@s-t-a-n
Copy link
Author

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

oops wrong repo sorry :(

EDIT: I'll leave it here since it seems to contain usefull edits.

@s-t-a-n s-t-a-n changed the title Replaced 'int' type with 'intptr_t' type in pointer arithmetic for compiling without -fpermisive Replaced 'int' type with 'intptr_t' type in pointer arithmetic for compiling without -fpermisive + revisions by McNeight Jan 17, 2021
@s-t-a-n s-t-a-n reopened this Jan 17, 2021
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.

3 participants