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

[armv7l] error: cast from pointer to integer of different size #397

Closed
garlick opened this issue Oct 19, 2018 · 4 comments
Closed

[armv7l] error: cast from pointer to integer of different size #397

garlick opened this issue Oct 19, 2018 · 4 comments

Comments

@garlick
Copy link
Member

garlick commented Oct 19, 2018

Encountered this buiuld error on armv7l:

  CC       libplanner_la-planner_multi.lo
planner_multi.c: In function ‘planner_multi_rem_span’:
planner_multi.c:414:49: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         if (planner_rem_span (ctx->planners[i], (int64_t)s) == -1)
                                                 ^
planner_multi.c: In function ‘planner_multi_span_first’:
planner_multi.c:436:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     rc = (int64_t)span;
          ^
planner_multi.c: In function ‘planner_multi_span_next’:
planner_multi.c:453:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     rc = (int64_t)span;
          ^
cc1: all warnings being treated as errors
garlick added a commit to garlick/flux-sched that referenced this issue Oct 20, 2018
Problem: compilation fails on armv7l architecture wtih

C       libplanner_la-planner_multi.lo
planner_multi.c: In function ‘planner_multi_rem_span’:
planner_multi.c:414:49: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         if (planner_rem_span (ctx->planners[i], (int64_t)s) == -1)
                                                 ^
planner_multi.c: In function ‘planner_multi_span_first’:
planner_multi.c:436:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     rc = (int64_t)span;
          ^
planner_multi.c: In function ‘planner_multi_span_next’:
planner_multi.c:453:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     rc = (int64_t)span;
          ^

Cast to uintptr_t instead.

Fixes flux-framework#397
garlick added a commit to garlick/flux-sched that referenced this issue Oct 20, 2018
Problem: compilation fails on armv7l architecture wtih

   CC       libplanner_la-planner_multi.lo
planner_multi.c: In function ‘planner_multi_rem_span’:
planner_multi.c:414:49: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         if (planner_rem_span (ctx->planners[i], (int64_t)s) == -1)
                                                 ^
planner_multi.c: In function ‘planner_multi_span_first’:
planner_multi.c:436:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     rc = (int64_t)span;
          ^
planner_multi.c: In function ‘planner_multi_span_next’:
planner_multi.c:453:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     rc = (int64_t)span;
          ^

Cast to uintptr_t instead.

Fixes flux-framework#397
@dongahn
Copy link
Member

dongahn commented Oct 20, 2018

I will have to look at #395 and submit a PR next. So as part of that, I will also check-pick these changes @garlick. Thank you for testing this on armv7l!

@garlick
Copy link
Member Author

garlick commented Oct 20, 2018

Sounds good - I'll just leave it there for you to cherry-pick.

@dongahn
Copy link
Member

dongahn commented Oct 23, 2018

@garlick: is armv7l a 32bit system?

@garlick
Copy link
Member Author

garlick commented Oct 24, 2018

Yep:

$ dpkg-architecture -l | grep HOST_ARCH
DEB_HOST_ARCH=armhf
DEB_HOST_ARCH_ABI=eabihf
DEB_HOST_ARCH_BITS=32
DEB_HOST_ARCH_CPU=arm
DEB_HOST_ARCH_ENDIAN=little
DEB_HOST_ARCH_LIBC=gnu
DEB_HOST_ARCH_OS=linux

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

No branches or pull requests

2 participants