From 5887f8a558cc8bf8d0ba4b7a00828ee00639eedb Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 30 Aug 2024 15:29:27 +0200 Subject: [PATCH] [warnings] suppress warnings Some warnings can not be solved as they depend on external libraries or limitations of the C standard. Suppress these warnings selectively --- channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 4 ++++ client/X11/xf_client.c | 8 ++++++++ libfreerdp/core/freerdp.c | 3 +++ libfreerdp/core/rdp.c | 5 +++++ winpr/libwinpr/crypto/hash.c | 3 +++ 5 files changed, 23 insertions(+) diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c index b3b1adea2..ff72079a6 100644 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c @@ -162,7 +162,11 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP UINT32 size = 0; const BYTE* s = NULL; TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*)decoder; + + WINPR_PRAGMA_DIAG_PUSH + WINPR_PRAGMA_DIAG_IGNORED_QUALIFIERS mdecoder->codec = avcodec_find_decoder(mdecoder->codec_id); + WINPR_PRAGMA_DIAG_POP if (!mdecoder->codec) { diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index 4031d77ea..f1a868b2a 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1306,11 +1306,19 @@ static DWORD WINAPI xf_handle_pipe(void* arg) winpr_strerror(errno, ebuffer, sizeof(ebuffer)), errno); return 0; } + + WINPR_PRAGMA_DIAG_PUSH + WINPR_PRAGMA_DIAG_IGNORED_QUALIFIERS freerdp_add_signal_cleanup_handler(pipe, cleanup_pipe); + WINPR_PRAGMA_DIAG_POP xf_process_pipe(context, pipe); + WINPR_PRAGMA_DIAG_PUSH + WINPR_PRAGMA_DIAG_IGNORED_QUALIFIERS freerdp_del_signal_cleanup_handler(pipe, cleanup_pipe); + WINPR_PRAGMA_DIAG_POP + unlink(pipe); return 0; } diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 5377a9d60..5eaafd713 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -718,12 +718,15 @@ const char* freerdp_get_version_string(void) const char* freerdp_get_build_config(void) { + WINPR_PRAGMA_DIAG_PUSH + WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS static const char build_config[] = "Build configuration: " FREERDP_BUILD_CONFIG "\n" "Build type: " FREERDP_BUILD_TYPE "\n" "CFLAGS: " FREERDP_CFLAGS "\n" "Compiler: " FREERDP_COMPILER_ID ", " FREERDP_COMPILER_VERSION "\n" "Target architecture: " FREERDP_TARGET_ARCH "\n"; + WINPR_PRAGMA_DIAG_POP return build_config; } diff --git a/libfreerdp/core/rdp.c b/libfreerdp/core/rdp.c index 7783cfe26..17e6c0f69 100644 --- a/libfreerdp/core/rdp.c +++ b/libfreerdp/core/rdp.c @@ -2852,9 +2852,14 @@ static void log_build_warn(rdpRdp* rdp, const char* what, const char* msg, BOOL (*cmp)(wLog* log, const char* tok)) { WINPR_ASSERT(rdp); + WINPR_PRAGMA_DIAG_PUSH + WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS + size_t len = sizeof(FREERDP_BUILD_CONFIG); char* list = calloc(len, sizeof(char)); char* config = _strdup(FREERDP_BUILD_CONFIG); + WINPR_PRAGMA_DIAG_POP + if (config && list) { char* tok = strtok(config, " "); diff --git a/winpr/libwinpr/crypto/hash.c b/winpr/libwinpr/crypto/hash.c index e67a11c4b..9effce238 100644 --- a/winpr/libwinpr/crypto/hash.c +++ b/winpr/libwinpr/crypto/hash.c @@ -235,9 +235,12 @@ BOOL winpr_HMAC_Init(WINPR_HMAC_CTX* ctx, WINPR_MD_TYPE md, const void* key, siz if (!ctx->xhmac) return FALSE; + WINPR_PRAGMA_DIAG_PUSH + WINPR_PRAGMA_DIAG_IGNORED_QUALIFIERS const char* param_name = OSSL_MAC_PARAM_DIGEST; const OSSL_PARAM param[] = { OSSL_PARAM_construct_utf8_string(param_name, hash, 0), OSSL_PARAM_construct_end() }; + WINPR_PRAGMA_DIAG_POP if (EVP_MAC_init(ctx->xhmac, key, keylen, param) == 1) return TRUE;