Skip to content

Commit

Permalink
meson: apply libplacebo patch to suppress some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper93 committed Oct 23, 2023
1 parent 158cebd commit c8b432c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions subprojects/libplacebo.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -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
67 changes: 67 additions & 0 deletions subprojects/packagefiles/mr_616.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From a75d059fbe085709c840d16b2037b53d384d9dcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
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?= <[email protected]>
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

0 comments on commit c8b432c

Please sign in to comment.