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

Replace Maddr with uintptr_t #69

Open
harrysarson opened this issue Mar 4, 2019 · 0 comments
Open

Replace Maddr with uintptr_t #69

harrysarson opened this issue Mar 4, 2019 · 0 comments
Assignees

Comments

@harrysarson
Copy link
Contributor

Problem

  • make gives a fair few warnings: warning: cast from pointer to integer of different size.
  • These are all due to casts from void * (32 bit) to Maddr (64 bit).

Solutions

  • This cast is safe (as the number of bits are increasing) so we could turn off the warning.
  • However, there is a type designed for storing pointers as an int: uintptr_t (https://en.cppreference.com/w/c/types/integer).
  • The Maddr is only using in mmalloc.c. Unless there is some deeper perpose behind Maddr that I am missing we seem to have "reinvented the wheel" and we could simplify the code base as well as removing these compiler warnings by using uintptr_t here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants