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

lint: lpc1768/msp430: remove arith ops on void ptrs #1662

Merged
merged 2 commits into from
Sep 14, 2014

Conversation

N8Fear
Copy link

@N8Fear N8Fear commented Sep 13, 2014

Cleanup: cppcheck found arithmetic operations on void pointers which can result in undefined behaviour.

This patch fixes it by casting it to the appropriate type (which follows the same logic as i.e. for the cortex-mX or the atmega_common equivalents).

@N8Fear N8Fear added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer labels Sep 13, 2014
@Kijewski
Copy link
Contributor

uintptr_t

@N8Fear
Copy link
Author

N8Fear commented Sep 14, 2014

Seems to make sense: should I also change this for other cpus (like the cortex ones)?

@Kijewski
Copy link
Contributor

Yes, would make sense to fix this in one go.

@N8Fear
Copy link
Author

N8Fear commented Sep 14, 2014

Changed original commit to use uintptr_t and added an additional commit that changes the cast for arm/cortex-mX and atmega to also use uintptr_t.

@Kijewski
Copy link
Contributor

Thanks! ACK.

Kijewski added a commit that referenced this pull request Sep 14, 2014
lint: lpc1768/msp430: remove arith ops on void ptrs
@Kijewski Kijewski merged commit acef250 into RIOT-OS:master Sep 14, 2014
@N8Fear N8Fear deleted the void_ptr_arith branch September 14, 2014 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants