From c8b432ce297b76510bc3cbdc00863702d36a5764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 23 Oct 2023 15:07:49 +0200 Subject: [PATCH] meson: apply libplacebo patch to suppress some warnings --- meson.build | 2 +- subprojects/libplacebo.wrap | 1 + subprojects/packagefiles/mr_616.patch | 67 +++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 subprojects/packagefiles/mr_616.patch diff --git a/meson.build b/meson.build index 2ccba61138ddd..8dd6e60753f77 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project('mpv', 'c', license: ['GPL2+', 'LGPL2.1+'], version: files('./VERSION'), - meson_version: '>=0.62.0', + meson_version: '>=0.63.0', default_options: [ 'buildtype=debugoptimized', 'b_lundef=false', diff --git a/subprojects/libplacebo.wrap b/subprojects/libplacebo.wrap index d117e2f53ee4e..07cb9526520ba 100644 --- a/subprojects/libplacebo.wrap +++ b/subprojects/libplacebo.wrap @@ -4,3 +4,4 @@ url = https://code.videolan.org/videolan/libplacebo.git revision = v6.338.1 depth = 1 clone-recursive = true +diff_files = mr_616.patch diff --git a/subprojects/packagefiles/mr_616.patch b/subprojects/packagefiles/mr_616.patch new file mode 100644 index 0000000000000..a4df84b727505 --- /dev/null +++ b/subprojects/packagefiles/mr_616.patch @@ -0,0 +1,67 @@ +From a75d059fbe085709c840d16b2037b53d384d9dcc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= +Date: Mon, 23 Oct 2023 14:59:19 +0200 +Subject: [PATCH 1/2] log: suppress maybe-uninitialized warning false positive + +This will never be used uninitialized, guarded by use_dbghelp, but GCC +analysis is too shallow and fails to see that. +--- + src/log.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/log.c b/src/log.c +index d43f41749..0829dd3d3 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -281,7 +281,7 @@ void pl_log_stack_trace(pl_log log, enum pl_log_level lev) + HANDLE process = GetCurrentProcess(); + HMODULE dbghelp = LoadLibrary("dbghelp.dll"); + DWORD options; +- SYMBOL_INFO *symbol; ++ SYMBOL_INFO *symbol = NULL; + BOOL use_dbghelp = !!dbghelp; + + #define DBGHELP_SYM(sym) \ +-- +GitLab + + +From 5c03d91ba5696c62b85bf37fefafca4733acf91a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= +Date: Mon, 23 Oct 2023 15:02:06 +0200 +Subject: [PATCH 2/2] shaders/custom: suppress -Werror=stringop-overflow= false + positives + +GCC is confused... +--- + src/shaders/custom_mpv.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/shaders/custom_mpv.c b/src/shaders/custom_mpv.c +index 4ef08178b..b9f71720b 100644 +--- a/src/shaders/custom_mpv.c ++++ b/src/shaders/custom_mpv.c +@@ -230,6 +230,10 @@ static bool parse_hook(pl_log log, pl_str *body, struct custom_shader_hook *out) + continue; + } + ++#if defined(__GNUC__) && !defined(__clang__) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wstringop-overflow=" ++#endif + if (pl_str_eatstart0(&line, "WIDTH")) { + if (!parse_rpn_shexpr(line, out->width)) { + pl_err(log, "Error while parsing WIDTH!"); +@@ -253,6 +257,9 @@ static bool parse_hook(pl_log log, pl_str *body, struct custom_shader_hook *out) + } + continue; + } ++#if defined(__GNUC__) && !defined(__clang__) ++# pragma GCC diagnostic pop ++#endif + + if (pl_str_eatstart0(&line, "COMPONENTS")) { + if (!pl_str_parse_int(pl_str_strip(line), &out->comps)) { +-- +GitLab +