inttypes. h should be used on the Linux platform instead of the custom macro PRIuPTR
;lmlmklxn
576420940 at qq.com
Wed Jul 3 02:59:00 UTC 2024
hi all,
When compiling jdk8u from x86_64, there is an alarm message as shown below.
jdk/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c:719:3: note: in expansion of macro ‘TRACE1’
719 | TRACE1("[GSSLibStub_getCredName] pName=%" PRIuPTR "", (uintptr_t) nameHdl);
| ^~~~~~
jdk/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c: In function ‘Java_sun_security_jgss_wrapper_GSSLibStub_importContext’:
jdk/src/share/native/sun/security/jgss/wrapper/NativeUtil.h:92:52: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
PRIuPTR is redefined in jdk/src/share/native/sun/security/jgss/wrapper/NativeUtil.h
----------------------------------
#if _MSC_VER >= 1800
# include <inttypes.h>
#endif
// Visual Studio 2010-2012 doesn't provide inttypes.h so provide appropriate definitions here.
#if _MSC_VER < 1800
#ifdef _LP64
#define PRIuPTR "I64u"
#else
#define PRIuPTR "u"
#endif
#endif
----------------------------------
Upon checking the code, it was found that the custom macro PRIuPTR was used in the Linux system. The header file # include<inttypes.h> should be used in linux.
There are two solutions, one is limit the usage range of custom macros to visual studio 2010-2012.and the other is remove special macro definitions related to _MSC_VER.
Is this issue a bug? If it is a bug, can you create a problem on JBS. thank you!
;lmlmklxn
576420940 at qq.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk8u-dev/attachments/20240703/3422e826/attachment-0001.htm>
More information about the jdk8u-dev
mailing list