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

libsel4allocman: fix clang warnings for printing #86

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

axel-h
Copy link
Member

@axel-h axel-h commented Nov 24, 2023

Clang does a few more checks than gcc for the prinf() parameters and raises some warning for 64-bit. See e.g. https://github.com/axel-h/seL4_libs/actions/runs/6975395333/job/18982455268?pr=5

  /github/workspace/projects/seL4_libs/libsel4allocman/src/allocman.c:525:98: warning: format specifies type 'int' but the argument has type 'seL4_Word' (aka 'unsigned long') [-Wformat]
              ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
                                                        ~~                                         ^~~~~~~~~~
                                                        %lu
  /github/workspace/projects/util_libs/libutils/include/utils/zf_log.h:359:43: note: expanded from macro 'ZF_LOGE'
                          _ZF_LOG_IMP(ZF_LOG_ERROR, _ZF_LOG_TAG, __VA_ARGS__)
                                                                 ^~~~~~~~~~~
  /github/workspace/projects/util_libs/libutils/include/utils/zf_log.h:302:18: note: expanded from macro '_ZF_LOG_IMP'
                                                          lvl, tag, __VA_ARGS__); \
                                                                    ^~~~~~~~~~~
  /github/workspace/projects/seL4_libs/libsel4allocman/src/allocman.c:525:110: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
              ZF_LOGE("Failed to set reserve for {type: %d size_bits: %d} as one already exists.", chunk.type, chunk.size_bits);
                                                                      ~~                                       ^~~~~~~~~~~~~~~
                                                                      %zu
  /github/workspace/projects/util_libs/libutils/include/utils/zf_log.h:359:43: note: expanded from macro 'ZF_LOGE'
                          _ZF_LOG_IMP(ZF_LOG_ERROR, _ZF_LOG_TAG, __VA_ARGS__)
                                                                 ^~~~~~~~~~~
  /github/workspace/projects/util_libs/libutils/include/utils/zf_log.h:302:18: note: expanded from macro '_ZF_LOG_IMP'
                                                          lvl, tag, __VA_ARGS__); \
                                                                    ^~~~~~~~~~~
  /github/workspace/projects/seL4_libs/libsel4allocman/src/allocman.c:587:84: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
              ZF_LOGE("Failed to set reserve for {size: %d} as one already exists.", chunk.size);
                                                        ~~                           ^~~~~~~~~~
                                                        %zu
  /github/workspace/projects/util_libs/libutils/include/utils/zf_log.h:359:43: note: expanded from macro 'ZF_LOGE'
                          _ZF_LOG_IMP(ZF_LOG_ERROR, _ZF_LOG_TAG, __VA_ARGS__)
                                                                 ^~~~~~~~~~~
  /github/workspace/projects/util_libs/libutils/include/utils/zf_log.h:302:18: note: expanded from macro '_ZF_LOG_IMP'
                                                          lvl, tag, __VA_ARGS__); \
                                                                    ^~~~~~~~~~~

@axel-h
Copy link
Member Author

axel-h commented Feb 22, 2024

Please, can we merge this to get rid of the build warning?

@kent-mcleod kent-mcleod merged commit 23477c7 into seL4:master Feb 22, 2024
17 checks passed
@axel-h axel-h deleted the patch-axel-7 branch February 22, 2024 20:54
Copy link

@Indanz Indanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too.

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.

3 participants