-
Notifications
You must be signed in to change notification settings - Fork 728
Cleanup output format warnings #904
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
Conversation
Signed-off-by: Huang Qi <[email protected]>
There was a problem hiding this 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
core/iwasm/compilation/aot_llvm.c
Outdated
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be PRIX32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
No description provided.