Add pointer casts for GCC 14/C89 compatibility

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
Florian Weimer 2024-02-01 08:47:10 +01:00
parent 769893caf6
commit c410dd827b
2 changed files with 37 additions and 1 deletions

31
c89.patch Normal file
View File

@ -0,0 +1,31 @@
Add casts required for C89 compatibility. This addresses a build
failure with GCC 14.
Submitted upstream: <https://sourceforge.net/p/sblim/bugs/2771/>
diff --git a/TEST/v2test_ec.c b/TEST/v2test_ec.c
index 940ca57638ceec79..042a9a0c4d5a7abf 100644
--- a/TEST/v2test_ec.c
+++ b/TEST/v2test_ec.c
@@ -83,7 +83,7 @@ int main()
count = enm->ft->hasNext(enm, NULL) ;
while (count > 0) {
data = enm->ft->getNext(enm, NULL);
- showClass(data.value.cls);
+ showClass((CMPIConstClass *) data.value.cls);
/*
* see if we have any more
*/
diff --git a/TEST/v2test_ein.c b/TEST/v2test_ein.c
index ede95c18a5b48ff8..712c204bd3aac357 100644
--- a/TEST/v2test_ein.c
+++ b/TEST/v2test_ein.c
@@ -93,7 +93,7 @@ int count = 0;
data = enm->ft->getNext(enm, NULL);
- showObjectPath(data.value.ref);
+ showObjectPath((CMPIObjectPath *) data.value.ref);
/*
* see if we have any more
*/

View File

@ -7,7 +7,7 @@
Summary: Small Footprint CIM Client Library
Name: sblim-sfcc
Version: 2.2.8
Release: 24%{?dist}
Release: 25%{?dist}
License: EPL-1.0
URL: http://www.sblim.org
Source0: http://downloads.sourceforge.net/project/sblim/%{name}/%{name}-%{version}.tar.bz2
@ -15,6 +15,7 @@ Source0: http://downloads.sourceforge.net/project/sblim/%{name}/%{name}-%{versio
# which is included through %%license
Patch0: sblim-sfcc-2.2.8-docdir-license.patch
Patch1: c99.patch
Patch2: c89.patch
BuildRequires: make
BuildRequires: curl-devel chrpath
BuildRequires: gcc gcc-c++
@ -35,6 +36,7 @@ Small Footprint CIM Client Library Header Files and Link Libraries
%setup -q
%patch0 -p1 -b .docdir-license
%patch1 -p1 -b .c99
%patch -P 2 -p1
%build
chmod a-x backend/cimxml/*.[ch]
@ -66,6 +68,9 @@ chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libcmpisfcc.so.1.0.0
%{_libdir}/libcmpisfcc.so
%changelog
* Thu Feb 01 2024 Florian Weimer <fweimer@redhat.com> - 2.2.8-25
- Add pointer casts for GCC 14/C89 compatibility
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.8-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild