Backport upstream patch to fix C compatibility issue
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
7fb7ff70ff
commit
32d6dd5c60
40
libcomps-c99.patch
Normal file
40
libcomps-c99.patch
Normal file
@ -0,0 +1,40 @@
|
||||
commit a71bce7e62990550a57688e51b14eb82d6de196b
|
||||
Author: Aleš Matěj <amatej@redhat.com>
|
||||
Date: Tue Jan 2 08:32:55 2024 +0100
|
||||
|
||||
Fix build: use correct variable for category and env
|
||||
|
||||
Fixes:
|
||||
- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocCategory *’
|
||||
- error: assignment to ‘COMPS_DocGroup *’ from incompatible pointer type ‘COMPS_DocEnv *’
|
||||
|
||||
For: https://fedoraproject.org/wiki/Changes/PortingToModernC
|
||||
(https://fedoraproject.org/wiki/Toolchain/PortingToModernC)
|
||||
(https://gitlab.com/fweimer-rh/fedora-modernc-logs/-/blob/main/logs/l/libcomps.log)
|
||||
|
||||
diff --git a/libcomps/tests/check_parse.c b/libcomps/tests/check_parse.c
|
||||
index e5935e129e43e4e7..689cb98da3a631b0 100644
|
||||
--- a/libcomps/tests/check_parse.c
|
||||
+++ b/libcomps/tests/check_parse.c
|
||||
@@ -585,8 +585,8 @@ START_TEST(test_arch)
|
||||
list = comps_doc_categories(doc2);
|
||||
ck_assert(list->len == 2);
|
||||
for (it = list->first, x=0; it != NULL; it = it->next, x++) {
|
||||
- g = (COMPS_DocCategory*)it->comps_obj;
|
||||
- str = (COMPS_Str*)comps_doccategory_get_id(g);
|
||||
+ c = (COMPS_DocCategory*)it->comps_obj;
|
||||
+ str = (COMPS_Str*)comps_doccategory_get_id(c);
|
||||
ck_assert_msg(strcmp(str->val, cats[0][x]) == 0, "%s != %s",
|
||||
str->val, cats[0][x]);
|
||||
COMPS_OBJECT_DESTROY(str);
|
||||
@@ -605,8 +605,8 @@ START_TEST(test_arch)
|
||||
list = comps_doc_environments(doc2);
|
||||
ck_assert(list->len == 2);
|
||||
for (it = list->first, x=0; it != NULL; it = it->next, x++) {
|
||||
- g = (COMPS_DocEnv*)it->comps_obj;
|
||||
- str = (COMPS_Str*)comps_docenv_get_id(g);
|
||||
+ e = (COMPS_DocEnv*)it->comps_obj;
|
||||
+ str = (COMPS_Str*)comps_docenv_get_id(e);
|
||||
ck_assert_msg(strcmp(str->val, envs[0][x]) == 0, "%s != %s",
|
||||
str->val, envs[0][x]);
|
||||
COMPS_OBJECT_DESTROY(str);
|
@ -2,7 +2,7 @@
|
||||
|
||||
Name: libcomps
|
||||
Version: 0.1.20
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: Comps XML file manipulation library
|
||||
|
||||
License: GPL-2.0-or-later
|
||||
@ -12,6 +12,7 @@ Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
# Fix build with libxml2 2.12.0
|
||||
# https://github.com/rpm-software-management/libcomps/pull/109
|
||||
Patch0: fix-build-libxml2-2.12.0.patch
|
||||
Patch1: libcomps-c99.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: cmake
|
||||
@ -120,6 +121,9 @@ popd
|
||||
%{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info
|
||||
|
||||
%changelog
|
||||
* Wed Jan 03 2024 Florian Weimer <fweimer@redhat.com> - 0.1.20-3
|
||||
- Backport upstream patch to fix C compatibility issue
|
||||
|
||||
* Wed Dec 13 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.1.20-2
|
||||
- Fix build with libxml2-2.12.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user