[vlc-commits] [Git][videolan/vlc][3.0.x] contrib: harfbuzz: Don't treat -Wunused as an error, fix building with Clang 13

Jean-Baptiste Kempf gitlab at videolan.org
Wed Jun 9 22:36:32 UTC 2021



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
98ba1351 by Martin Storsjö at 2021-06-09T21:11:38+00:00
contrib: harfbuzz: Don't treat -Wunused as an error, fix building with Clang 13

This fixes building with the very latest nightly of Clang.

(cherry picked from commit 37cdeb672ed47ced022316ddf9f9e85c49f68913)

- - - - -


2 changed files:

- + contrib/src/harfbuzz/0004-Don-t-treat-Wunused-as-an-error.patch
- contrib/src/harfbuzz/rules.mak


Changes:

=====================================
contrib/src/harfbuzz/0004-Don-t-treat-Wunused-as-an-error.patch
=====================================
@@ -0,0 +1,47 @@
+From 130296d079a65b26b15acb9d0a69ef9497fad701 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Wed, 2 Jun 2021 09:49:24 +0300
+Subject: [PATCH 4/4] Don't treat -Wunused as an error
+
+This is a fragile warning - newer compilers can add warnings to cases
+that weren't there before.
+
+Clang 13 got support for the -Wunused-but-set-variable warning, which
+gets enabled implicitly via -Wunused, and it warns on one variable
+like this:
+
+hb-subset-cff1.cc:405:33: error: variable 'supp_size' set but not used [-Werror,
+-Wunused-but-set-variable]
+    unsigned int  size0, size1, supp_size;
+                                ^
+---
+ src/hb.hh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/hb.hh b/src/hb.hh
+index e46aa0b6e..b0beaaa81 100644
+--- a/src/hb.hh
++++ b/src/hb.hh
+@@ -86,10 +86,8 @@
+ #pragma GCC diagnostic error   "-Wswitch-enum"
+ #pragma GCC diagnostic error   "-Wtautological-overlap-compare"
+ #pragma GCC diagnostic error   "-Wunneeded-internal-declaration"
+-#pragma GCC diagnostic error   "-Wunused"
+ #pragma GCC diagnostic error   "-Wunused-local-typedefs"
+ #pragma GCC diagnostic error   "-Wunused-value"
+-#pragma GCC diagnostic error   "-Wunused-variable"
+ #pragma GCC diagnostic error   "-Wvla"
+ #pragma GCC diagnostic error   "-Wwrite-strings"
+ #endif
+@@ -107,6 +105,8 @@
+ #pragma GCC diagnostic warning "-Wmaybe-uninitialized"
+ #pragma GCC diagnostic warning "-Wmissing-format-attribute"
+ #pragma GCC diagnostic warning "-Wundef"
++#pragma GCC diagnostic warning "-Wunused"
++#pragma GCC diagnostic warning "-Wunused-variable"
+ #endif
+ 
+ /* Ignored currently, but should be fixed at some point. */
+-- 
+2.25.1
+


=====================================
contrib/src/harfbuzz/rules.mak
=====================================
@@ -17,6 +17,7 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.xz .sum-harfbuzz
 	$(APPLY) $(SRC)/harfbuzz/0001-fix-OSAtomic-calls-for-AArch64.patch
 	$(APPLY) $(SRC)/harfbuzz/0002-Update-the-bundled-ax_pthread.m4.patch
 	$(APPLY) $(SRC)/harfbuzz/0003-Fix-winstore-app-detection-with-mingw64.patch
+	$(APPLY) $(SRC)/harfbuzz/0004-Don-t-treat-Wunused-as-an-error.patch
 	$(MOVE)
 
 DEPS_harfbuzz = freetype2 $(DEPS_freetype2)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/98ba1351bad2927a257160af4dad01bc5211dd0b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/98ba1351bad2927a257160af4dad01bc5211dd0b
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list