-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Compile error with gcc-15 #1739
Comments
there is a release date for gcc 15 or is it still under development? time ago i introduced this CI mainly for gcc 14 |
I haven’t checked into this exact error yet. But I have been fixing the -std=c23 and bool problems that have surfaced with the use of gcc-15. I would agree not jumping in to make the changes, until we work out if this is a gcc bug, or that it is now adhering being pedantic to a xxx standard. Gcc-15 is now in Stage 3 (which is bug fixing) which is why I have started the process with the LE code base to fix as much of upstream (rather that after gcc-15 is released.)
Most of the patching and porting to gcc-15 for LE is now done, just a couple packages remaining with most of the patches submitted upstream - so that hopefully the fixed packages can be incorporated (apart from the unmaintained legacy packages that have no upstream.) I didn’t attempt this one yet as my c++ is not that great, but happy to take a look once I complete the rest of the porting. |
I remind you that kodi 22 must be built with C++ 20, not 23 |
The error interestingly it does build with |
I can confirm that it is building with c++20 for the original error. |
mmh ok maybe change /src/common/CommonSegAttribs.h |
@neo1973 perhaps you are better suited to understand this problem than me |
I tend to think GCC, or rather libstdc++, is correct here. This is a minimal example of the problem: https://godbolt.org/z/cf551EoTo As with our code it works with GCC 14.2 but not trunk (~GCC 15). If you remove the comment from either of the If we look into the documentation of Interesting observation: If you add a move constructor in the Godbolt example then even GCC 14.2 isn't happy anymore. This makes it more likely that the current code is already wrong. Here the patch that should make GCC 15 happy: Patchdiff --git a/src/common/SegTemplate.cpp b/src/common/SegTemplate.cpp
index dea1b6ec..f7fdce1c 100644
--- a/src/common/SegTemplate.cpp
+++ b/src/common/SegTemplate.cpp
@@ -19,12 +19,6 @@ using namespace PLAYLIST;
using namespace UTILS;
using namespace kodi::tools;
-PLAYLIST::CSegmentTemplate::CSegmentTemplate(const std::optional<CSegmentTemplate>& other)
-{
- if (other.has_value())
- *this = *other;
-}
-
std::string PLAYLIST::CSegmentTemplate::GetInitialization() const
{
if (!m_initialization.empty())
diff --git a/src/common/SegTemplate.h b/src/common/SegTemplate.h
index ae7b0192..ae86075e 100644
--- a/src/common/SegTemplate.h
+++ b/src/common/SegTemplate.h
@@ -29,7 +29,6 @@ class ATTR_DLL_LOCAL CSegmentTemplate
{
public:
CSegmentTemplate() = default;
- CSegmentTemplate(const std::optional<CSegmentTemplate>& other);
~CSegmentTemplate() = default;
std::string GetInitialization() const;
diff --git a/src/parser/DASHTree.cpp b/src/parser/DASHTree.cpp
index 17cce2bd..4587b231 100644
--- a/src/parser/DASHTree.cpp
+++ b/src/parser/DASHTree.cpp
@@ -583,7 +583,10 @@ void adaptive::CDashTree::ParseTagAdaptationSet(pugi::xml_node nodeAdp, PLAYLIST
xml_node nodeSegTpl = nodeAdp.child("SegmentTemplate");
if (nodeSegTpl || period->HasSegmentTemplate())
{
- CSegmentTemplate segTemplate{period->GetSegmentTemplate()};
+ CSegmentTemplate segTemplate;
+ auto optSegTemplate = period->GetSegmentTemplate();
+ if (optSegTemplate)
+ segTemplate = std::move(*optSegTemplate);
if (nodeSegTpl)
ParseSegmentTemplate(nodeSegTpl, segTemplate);
@@ -824,7 +827,10 @@ void adaptive::CDashTree::ParseTagRepresentation(pugi::xml_node nodeRepr,
xml_node nodeSegTpl = nodeRepr.child("SegmentTemplate");
if (nodeSegTpl || adpSet->HasSegmentTemplate())
{
- CSegmentTemplate segTemplate{adpSet->GetSegmentTemplate()};
+ CSegmentTemplate segTemplate;
+ auto optSegTemplate = adpSet->GetSegmentTemplate();
+ if (optSegTemplate)
+ segTemplate = std::move(*optSegTemplate);
if (nodeSegTpl)
ParseSegmentTemplate(nodeSegTpl, segTemplate); |
I just tested with the patch and here is the output
|
Full log
|
Ahh, I overlooked the same thing for Patchdiff --git a/src/common/SegTemplate.cpp b/src/common/SegTemplate.cpp
index dea1b6ec..f7fdce1c 100644
--- a/src/common/SegTemplate.cpp
+++ b/src/common/SegTemplate.cpp
@@ -19,12 +19,6 @@ using namespace PLAYLIST;
using namespace UTILS;
using namespace kodi::tools;
-PLAYLIST::CSegmentTemplate::CSegmentTemplate(const std::optional<CSegmentTemplate>& other)
-{
- if (other.has_value())
- *this = *other;
-}
-
std::string PLAYLIST::CSegmentTemplate::GetInitialization() const
{
if (!m_initialization.empty())
diff --git a/src/common/SegTemplate.h b/src/common/SegTemplate.h
index ae7b0192..ae86075e 100644
--- a/src/common/SegTemplate.h
+++ b/src/common/SegTemplate.h
@@ -29,7 +29,6 @@ class ATTR_DLL_LOCAL CSegmentTemplate
{
public:
CSegmentTemplate() = default;
- CSegmentTemplate(const std::optional<CSegmentTemplate>& other);
~CSegmentTemplate() = default;
std::string GetInitialization() const;
diff --git a/src/common/SegmentList.cpp b/src/common/SegmentList.cpp
index 25f11451..2d76487a 100644
--- a/src/common/SegmentList.cpp
+++ b/src/common/SegmentList.cpp
@@ -12,12 +12,6 @@
using namespace PLAYLIST;
-PLAYLIST::CSegmentList::CSegmentList(const std::optional<CSegmentList>& other)
-{
- if (other.has_value())
- *this = *other;
-}
-
void PLAYLIST::CSegmentList::SetInitRange(std::string_view range)
{
if (!ParseRangeRFC(range, m_initRangeBegin, m_initRangeEnd))
diff --git a/src/common/SegmentList.h b/src/common/SegmentList.h
index ebefeb27..3e96c0cd 100644
--- a/src/common/SegmentList.h
+++ b/src/common/SegmentList.h
@@ -29,7 +29,6 @@ class ATTR_DLL_LOCAL CSegmentList
{
public:
CSegmentList() = default;
- CSegmentList(const std::optional<CSegmentList>& other);
~CSegmentList() = default;
uint64_t GetStartNumber() const { return m_startNumber; }
diff --git a/src/parser/DASHTree.cpp b/src/parser/DASHTree.cpp
index 17cce2bd..0549f2c9 100644
--- a/src/parser/DASHTree.cpp
+++ b/src/parser/DASHTree.cpp
@@ -583,7 +583,10 @@ void adaptive::CDashTree::ParseTagAdaptationSet(pugi::xml_node nodeAdp, PLAYLIST
xml_node nodeSegTpl = nodeAdp.child("SegmentTemplate");
if (nodeSegTpl || period->HasSegmentTemplate())
{
- CSegmentTemplate segTemplate{period->GetSegmentTemplate()};
+ CSegmentTemplate segTemplate;
+ auto optSegTemplate = period->GetSegmentTemplate();
+ if (optSegTemplate)
+ segTemplate = std::move(*optSegTemplate);
if (nodeSegTpl)
ParseSegmentTemplate(nodeSegTpl, segTemplate);
@@ -595,7 +598,10 @@ void adaptive::CDashTree::ParseTagAdaptationSet(pugi::xml_node nodeAdp, PLAYLIST
xml_node nodeSeglist = nodeAdp.child("SegmentList");
if (nodeSeglist)
{
- CSegmentList segList{adpSet->GetSegmentList()};
+ CSegmentList segList;
+ auto optSegList = adpSet->GetSegmentList();
+ if (optSegList)
+ segList = std::move(*optSegList);
uint64_t duration;
if (XML::QueryAttrib(nodeSeglist, "duration", duration))
@@ -824,7 +830,10 @@ void adaptive::CDashTree::ParseTagRepresentation(pugi::xml_node nodeRepr,
xml_node nodeSegTpl = nodeRepr.child("SegmentTemplate");
if (nodeSegTpl || adpSet->HasSegmentTemplate())
{
- CSegmentTemplate segTemplate{adpSet->GetSegmentTemplate()};
+ CSegmentTemplate segTemplate;
+ auto optSegTemplate = adpSet->GetSegmentTemplate();
+ if (optSegTemplate)
+ segTemplate = std::move(*optSegTemplate);
if (nodeSegTpl)
ParseSegmentTemplate(nodeSegTpl, segTemplate);
@@ -841,7 +850,10 @@ void adaptive::CDashTree::ParseTagRepresentation(pugi::xml_node nodeRepr,
xml_node nodeSeglist = nodeRepr.child("SegmentList");
if (nodeSeglist)
{
- CSegmentList segList{adpSet->GetSegmentList()};
+ CSegmentList segList;
+ auto optSegList = adpSet->GetSegmentList();
+ if (optSegList)
+ segList = std::move(*optSegList);
uint64_t duration;
if (XML::QueryAttrib(nodeSeglist, "duration", duration)) |
Build completed - successfully - without error now. log below
|
Describe the problem
test compiling LE13 with gcc has identified some code compatibility and issues.
Possible fix
No response
Steps to reproduce
Compile with gcc-15-20241124
Debug log
Stream manifest file(s)
No response
Additional info
Using gcc15-20241124
Operating system(s)
Linux
Operating system version(s)
LibreELEC LE13 master
InputStream Adaptive version(s)
22.1.10
Kodi version(s)
Piers - 65703fe91c077d8cc11be4ba10221b56cd38d30b
The text was updated successfully, but these errors were encountered: