[vlc-commits] [Git][videolan/vlc][master] contrib: asdcplib: Apply a patch to fix compilation with latest Clang

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed May 22 10:02:56 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c481befc by Martin Storsjö at 2024-05-22T08:52:50+00:00
contrib: asdcplib: Apply a patch to fix compilation with latest Clang

The asdcplib code contains a C++ template which refers to member
variables that doesn't exist. Earlier, this hasn't been an issue,
as the C++ template never is instantiated, but current Clang
versions (the upcoming 19.x version) diagnoses such issues already
before the class is instantiated, leading to compilation errors
on the asdcplib code.

This applies https://github.com/cinecert/asdcplib/pull/137 (which
hasn't yet received any attention), fixing
https://github.com/cinecert/asdcplib/issues/136.

- - - - -


2 changed files:

- + contrib/src/asdcplib/0001-Remove-a-broken-unused-template-class.patch
- contrib/src/asdcplib/rules.mak


Changes:

=====================================
contrib/src/asdcplib/0001-Remove-a-broken-unused-template-class.patch
=====================================
@@ -0,0 +1,64 @@
+From ecbe9cac1fe74a6fcb42857f57ebd6930d6e8c62 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Mon, 6 May 2024 13:33:14 +0300
+Subject: [PATCH] Remove a broken, unused template class
+
+Since Clang changes
+https://github.com/llvm/llvm-project/pull/84050 and
+https://github.com/llvm/llvm-project/pull/90152 (upcoming in
+Clang 19.x), Clang will diagnose member accesses before instantiating
+C++ templates.
+
+Within the optional_container_property template, this causes errors
+for the calls to this->Copy() and this->clear(), as there are no
+corresponding methods within that template class.
+
+This template is unused, and these faulty calls have been present
+since the class was added in 02915821cfb49cb6851086f5d991cee58328102b.
+
+Simply remove the unused template class, to avoid these compiler
+errors.
+
+This fixes https://github.com/cinecert/asdcplib/issues/136.
+---
+ src/MXF.h | 24 ------------------------
+ 1 file changed, 24 deletions(-)
+
+diff --git a/src/MXF.h b/src/MXF.h
+index 8ce77e1..32422b2 100755
+--- a/src/MXF.h
++++ b/src/MXF.h
+@@ -263,30 +263,6 @@ namespace ASDCP
+ 	  const PropertyType& const_get() const { return m_property; }
+ 	};
+ 
+-      // wrapper object manages optional properties
+-      template <class PropertyType>
+-	class optional_container_property
+-	{
+-	  PropertyType m_property;
+-
+-	public:
+-	  optional_container_property() {}
+-	optional_container_property(const PropertyType& value) : m_property(value) {}
+-	  const optional_container_property<PropertyType>& operator=(const PropertyType& rhs) {
+-	    this->Copy(rhs.m_property);
+-	    return *this;
+-	  }
+-
+-	  bool operator==(const PropertyType& rhs) const { return this->m_property == rhs; }
+-	  bool operator==(const optional_property<PropertyType>& rhs) const { return this->m_property == rhs.m_property; }
+-	  operator PropertyType&() { return this->m_property; }
+-	  void set(const PropertyType& rhs) { this->m_property = rhs; }
+-	  void reset(const PropertyType& rhs) { this->clear(); }
+-	  bool empty() const { return ! this->m_property.HasValue(); }
+-	  PropertyType& get() { return m_property; }
+-	  const PropertyType& const_get() const { return m_property; }
+-	};
+-
+       // base class of all metadata objects
+       //
+       class InterchangeObject : public ASDCP::KLVPacket
+-- 
+2.34.1
+


=====================================
contrib/src/asdcplib/rules.mak
=====================================
@@ -39,6 +39,7 @@ asdcplib: asdcplib-$(ASDCPLIB_VERSION).tar.gz .sum-asdcplib
 	$(APPLY) $(SRC)/asdcplib/adding-pkg-config-file.patch
 	$(APPLY) $(SRC)/asdcplib/win32-cross-compilation.patch
 	$(APPLY) $(SRC)/asdcplib/win32-dirent.patch
+	$(APPLY) $(SRC)/asdcplib/0001-Remove-a-broken-unused-template-class.patch
 	$(MOVE)
 
 DEPS_asdcplib = nettle $(DEPS_nettle)



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

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c481befc9796ed57606d5fd7cba18449702d4cc2
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list