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

Avoid pointer arithmetic with (void *) pointers #644

Merged
merged 3 commits into from
Oct 21, 2015

Conversation

smuehlst
Copy link
Contributor

Taking the difference of two void * pointers is not defined according to the C specification, and for example the z/OS compiler warns:

./opj_malloc.c:169 Operation between types void* and void* is not allowed.

Stephan Mühlstrasser added 3 commits October 20, 2015 13:02
Used for platforms where none of posix_memalign(), memalign() and
_aligned_malloc() is available.
Conflicts:
	src/lib/openjp2/opj_malloc.c
@mayeut
Copy link
Collaborator

mayeut commented Oct 21, 2015

Exact, I forgot about this & got no warning on my compiler... Difference is only valid for 2 non void* pointers of the same type.

mayeut added a commit that referenced this pull request Oct 21, 2015
Avoid pointer arithmetic with (void *) pointers
@mayeut mayeut merged commit b06bed7 into uclouvain:master Oct 21, 2015
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.

None yet

2 participants