[jdk8u-dev] Withdrawn: 8031199: _MSC_VER is only defined on _WIN32 Backport
duke
duke at openjdk.org
Fri Sep 20 22:05:37 UTC 2024
On Mon, 8 Jul 2024 07:58:34 GMT, luwang1103 <duke at openjdk.org> wrote:
> hi,
>
> 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 defined 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. so, It is necessary to limit the scope of use of custom macros to visual studio 2010-2012.
>
> Thanks!
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/540
More information about the jdk8u-dev
mailing list