Skip to content
Commit 96772b2e authored by Like Xu's avatar Like Xu Committed by Thomas Huth
Browse files

lib: x86: Use portable format macros for uint32_t



Compilation of the files fails on ARCH=i386 with i686-elf gcc on macos_i386
because they use "%d" format specifier that does not match the actual size of
uint32_t:

In function 'rdpmc':
lib/libcflat.h:141:24: error: format '%d' expects argument of type 'int',
but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  141 |                 printf("%s:%d: assert failed: %s: " fmt "\n",           \
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Use PRId32 instead of "d" to take into account macos_i386 case.

Reported-by: default avatarThomas Huth <thuth@redhat.com>
Signed-off-by: default avatarLike Xu <likexu@tencent.com>
Message-Id: <20221124123149.91339-1-likexu@tencent.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent 952cf19c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment