Skip to content

Conversation

@no1wudi
Copy link
Collaborator

@no1wudi no1wudi commented Dec 19, 2021

No description provided.

Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

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

Hi, in our test, some compilers don't support these macros, could we add them in the end of core/shared/platform/include/platform_common.h if they are undefined:

#ifndef PRId32
#define PRId32     "d"
#endif
#ifndef PRIi32
#define PRIi32     "i"
#endif
#ifndef PRIu32
#define PRIu32     "u"
#endif
#ifndef PRIx32
#define PRIx32     "x"
#endif
#ifndef PRIX32
#define PRIX32     "X"
#endif

#ifndef __PRI64_PREFIX 
#if UINTPTR_MAX == UINT64_MAX
#define __PRI64_PREFIX "l"
#define __PRIPTR_PREFIX "l"
#else
#define __PRI64_PREFIX "ll"
#define __PRIPTR_PREFIX
#endif
#endif

#ifndef PRId64
# define PRId64    __PRI64_PREFIX "d"
#endif
#ifndef PRIu64
#define PRIu64     __PRI64_PREFIX "u"
#endif
#ifndef PRIx64
#define PRIx64     __PRI64_PREFIX "x"
#endif
#ifndef PRIX64
#define PRIX64     __PRI64_PREFIX "X"
#endif
#ifndef PRIXPTR
# define PRIXPTR  __PRIPTR_PREFIX "X"
#endif

case VALUE_TYPE_F32:
/* Store the raw int bits of f32 const as a hex string */
snprintf(buf, sizeof(buf), "f32#%08X", value->i32);
snprintf(buf, sizeof(buf), "f32#%08" PRIx32, value->i32);
Copy link
Contributor

@wenyongh wenyongh Dec 20, 2021

Choose a reason for hiding this comment

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

Should be PRIX32

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@xujuntwt95329 xujuntwt95329 left a comment

Choose a reason for hiding this comment

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

LGTM

@wenyongh wenyongh merged commit 4cc4625 into bytecodealliance:main Dec 20, 2021
@no1wudi no1wudi deleted the log branch March 4, 2022 09:08
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Use `PRIxxx` related macros to format the output strings so as to clear
compile warnings, e.g. PRIu32, PRId32, PRIX32, PRIX64 and so on.
And add the related macro definitions in platform_common.h if they
are not defined, as some compilers might not support them.
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