From: Tomas Mraz Date: Wed, 23 Jun 2021 15:16:36 +0000 (+0200) Subject: trace: Do not produce dead code calling BIO_printf if disabled X-Git-Tag: openssl-3.0.0-beta2~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=454d69271cf65edb1f6d0ca2a06f9b755f6cb937;p=thirdparty%2Fopenssl.git trace: Do not produce dead code calling BIO_printf if disabled Fixes #15880 Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15882) --- diff --git a/include/openssl/trace.h b/include/openssl/trace.h index e88ad9d13d8..b3a29ea8c4e 100644 --- a/include/openssl/trace.h +++ b/include/openssl/trace.h @@ -270,11 +270,19 @@ void OSSL_trace_end(int category, BIO *channel); * 42, "What do you get when you multiply six by nine?"); */ -# define OSSL_TRACEV(category, args) \ +# if !defined OPENSSL_NO_TRACE && !defined FIPS_MODULE + +# define OSSL_TRACEV(category, args) \ OSSL_TRACE_BEGIN(category) \ BIO_printf args; \ OSSL_TRACE_END(category) +# else + +# define OSSL_TRACEV(category, args) ((void)0) + +# endif + # define OSSL_TRACE(category, text) \ OSSL_TRACEV(category, (trc_out, "%s", text))