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

allocman: fix build warning on native X86 simulate #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anchao
Copy link
Contributor

@anchao anchao commented Sep 11, 2023

allocman: fix build warning on native X86 simulate

archer@c:~/code/sel4/build-x86$ ninja
[1/6] Building C object apps/sel4test-driver/seL4_libs/libsel4allocman/CMakeFiles/sel4allocman.dir/src/allocman.c.obj
In file included from /home/archer/code/sel4/projects/util_libs/libutils/include/utils/util.h:46,
                 from /home/archer/code/sel4/projects/seL4_libs/libsel4utils/include/sel4utils/util.h:13,
                 from /home/archer/code/sel4/projects/seL4_libs/libsel4allocman/include/allocman/util.h:20,
                 from /home/archer/code/sel4/projects/seL4_libs/libsel4allocman/include/allocman/allocman.h:51,
                 from /home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:7:
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c: In function ‘allocman_configure_utspace_reserve’:
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:525:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘seL4_Word’ {aka ‘long unsigned int’} [-Wformat=]
  525 |             ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~
      |                                                                                                       |
      |                                                                                                       seL4_Word {aka long unsigned int}
/home/archer/code/sel4/projects/util_libs/libutils/include/utils/zf_log.h:302:67: note: in definition of macro ‘_ZF_LOG_IMP’
  302 |                                                         lvl, tag, __VA_ARGS__); \
      |                                                                   ^~~~~~~~~~~
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:525:13: note: in expansion of macro ‘ZF_LOGE’
  525 |             ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
      |             ^~~~~~~
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:525:56: note: format string is defined here
  525 |             ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
      |                                                       ~^
      |                                                        |
      |                                                        int
      |                                                       %ld
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:525:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  525 |             ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~              ~~~~~~~~~~~~~~~
      |                                                                                                                   |
      |                                                                                                                   size_t {aka long unsigned int}
/home/archer/code/sel4/projects/util_libs/libutils/include/utils/zf_log.h:302:67: note: in definition of macro ‘_ZF_LOG_IMP’
  302 |                                                         lvl, tag, __VA_ARGS__); \
      |                                                                   ^~~~~~~~~~~
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:525:13: note: in expansion of macro ‘ZF_LOGE’
  525 |             ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
      |             ^~~~~~~
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:525:70: note: format string is defined here
  525 |             ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
      |                                                                     ~^
      |                                                                      |
      |                                                                      int
      |                                                                     %ld
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c: In function ‘allocman_configure_mspace_reserve’:
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:587:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  587 |             ZF_LOGE("Failed to set reserve for {size: %d} as one already exists.", chunk.size);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~
      |                                                                                         |
      |                                                                                         size_t {aka long unsigned int}
/home/archer/code/sel4/projects/util_libs/libutils/include/utils/zf_log.h:302:67: note: in definition of macro ‘_ZF_LOG_IMP’
  302 |                                                         lvl, tag, __VA_ARGS__); \
      |                                                                   ^~~~~~~~~~~
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:587:13: note: in expansion of macro ‘ZF_LOGE’
  587 |             ZF_LOGE("Failed to set reserve for {size: %d} as one already exists.", chunk.size);
      |             ^~~~~~~
/home/archer/code/sel4/projects/seL4_libs/libsel4allocman/src/allocman.c:587:56: note: format string is defined here
  587 |             ZF_LOGE("Failed to set reserve for {size: %d} as one already exists.", chunk.size);
      |                                                       ~^
      |                                                        |
      |                                                        int
      |                                                       %ld
[6/6] Generating ../../images/sel4test-driver-image-x86_64-pc99

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.

1 participant