RFR: 8345757: [ASAN] clang17 report 'dprintf' macro redefined [v3]

Kim Barrett kbarrett at openjdk.org
Sat Dec 21 16:14:40 UTC 2024


On Sat, 21 Dec 2024 16:02:46 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add comments // GNU, POSIX.1-2008
>
> src/java.smartcardio/share/native/libj2pcsc/pcsc.c line 48:
> 
>> 46: #define dprintf3(s, p1, p2, p3) printf(s, p1, p2, p3)
>> 47: #else
>> 48: #undef dprintf // GNU, POSIX.1-2008
> 
> Shouldn't this be before the `#ifdef J2PSC_DEBUG`?  Otherwise, we'll get the same problem when
> debugging is enabled.

A more sweeping change would be to rename this dprintf macro to (say) debug_printf, make it
variadic, and get rid of the various dprintfN variants.  I'm okay with the current approach as an
unbreak-the-build fix though.

> src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.h line 45:
> 
>> 43: #define dprintf3(s, p1, p2, p3) printf(s, p1, p2, p3)
>> 44: #else
>> 45: #undef dprintf // GNU, POSIX.1-2008
> 
> Shouldn't this be before the #ifdef SECMOD_DEBUG? Otherwise, we'll get the same problem when
> debugging is enabled.

A more sweeping change would be to rename this dprintf macro to (say) debug_printf, make it
variadic, and get rid of the various dprintfN variants.  I'm okay with the current approach as an
unbreak-the-build fix though.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22630#discussion_r1894652037
PR Review Comment: https://git.openjdk.org/jdk/pull/22630#discussion_r1894652048


More information about the build-dev mailing list