seL4 / seL4_libs

No-assurance libraries for rapid-prototyping of seL4 apps.
https://docs.sel4.systems
Other
52 stars 62 forks source link

allocman: fix build warning on native X86 simulate #79

Open anchao opened 9 months ago

anchao commented 9 months ago

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