Fix C compatibility issues
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
d2b7872b70
commit
6e3befd4e1
25
openscap-c99-2.patch
Normal file
25
openscap-c99-2.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Python bindings: Do not reuse $result for pointer conversion result
|
||||||
|
|
||||||
|
The $result variable may be a pointer, but SWIG_ConvertPtr returns
|
||||||
|
an int. This change avoids a compilation failure with current
|
||||||
|
compilers due to a C type error.
|
||||||
|
|
||||||
|
Submitted upstream: <https://github.com/OpenSCAP/openscap/pull/2069>x
|
||||||
|
|
||||||
|
diff --git a/swig/openscap.i b/swig/openscap.i
|
||||||
|
index 219e1aa3c9ddf28b..6f29fc23c808bcfc 100644
|
||||||
|
--- a/swig/openscap.i
|
||||||
|
+++ b/swig/openscap.i
|
||||||
|
@@ -64,9 +64,9 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(in) void * {
|
||||||
|
- $result = SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown);
|
||||||
|
- if (!SWIG_IsOK($result)) {
|
||||||
|
- %argument_fail($result, "$type", $symname, $argnum);
|
||||||
|
+ int ptrres = SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown);
|
||||||
|
+ if (!SWIG_IsOK(ptrres)) {
|
||||||
|
+ %argument_fail(ptrres, "$type", $symname, $argnum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
41
openscap-c99.patch
Normal file
41
openscap-c99.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
Fix type of libxml2 error callback function
|
||||||
|
|
||||||
|
Current libxml2 uses void(void *user, const xmlError *error),
|
||||||
|
previously void(void *user, xmlError *error) was used. Switch the
|
||||||
|
function definition to the current type and add a cast to avoid
|
||||||
|
incompatible-pointer-types errors with newer compilers building
|
||||||
|
against older libxml2.
|
||||||
|
|
||||||
|
Submitted upstream: <https://github.com/OpenSCAP/openscap/pull/2069>x
|
||||||
|
|
||||||
|
diff --git a/src/source/validate.c b/src/source/validate.c
|
||||||
|
index da8c46dcb185c3fe..ffc54f55031746fc 100644
|
||||||
|
--- a/src/source/validate.c
|
||||||
|
+++ b/src/source/validate.c
|
||||||
|
@@ -46,7 +46,7 @@ struct ctxt {
|
||||||
|
char *filename;
|
||||||
|
};
|
||||||
|
|
||||||
|
-static void oscap_xml_validity_handler(void *user, xmlErrorPtr error)
|
||||||
|
+static void oscap_xml_validity_handler(void *user, const xmlError *error)
|
||||||
|
{
|
||||||
|
struct ctxt * context = (struct ctxt *) user;
|
||||||
|
|
||||||
|
@@ -111,7 +111,7 @@ static inline int oscap_validate_xml(struct oscap_source *source, const char *sc
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
- xmlSchemaSetParserStructuredErrors(parser_ctxt, oscap_xml_validity_handler, &context);
|
||||||
|
+ xmlSchemaSetParserStructuredErrors(parser_ctxt, (xmlStructuredErrorFunc) oscap_xml_validity_handler, &context);
|
||||||
|
|
||||||
|
schema = xmlSchemaParse(parser_ctxt);
|
||||||
|
if (schema == NULL) {
|
||||||
|
@@ -125,7 +125,7 @@ static inline int oscap_validate_xml(struct oscap_source *source, const char *sc
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
- xmlSchemaSetValidStructuredErrors(ctxt, oscap_xml_validity_handler, &context);
|
||||||
|
+ xmlSchemaSetValidStructuredErrors(ctxt, (xmlStructuredErrorFunc) oscap_xml_validity_handler, &context);
|
||||||
|
|
||||||
|
doc = oscap_source_get_xmlDoc(source);
|
||||||
|
if (!doc)
|
@ -1,6 +1,6 @@
|
|||||||
Name: openscap
|
Name: openscap
|
||||||
Version: 1.3.9
|
Version: 1.3.9
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Summary: Set of open source libraries enabling integration of the SCAP line of standards
|
Summary: Set of open source libraries enabling integration of the SCAP line of standards
|
||||||
License: LGPL-2.1-or-later
|
License: LGPL-2.1-or-later
|
||||||
@ -21,6 +21,8 @@ Patch2: openscap-1.3.9-includes.patch
|
|||||||
|
|
||||||
# Fix test test_sysctl_probe_all.sh
|
# Fix test test_sysctl_probe_all.sh
|
||||||
Patch3: openscap-1.3.10-fix_sysctl_probe_tests-PR-2050.patch
|
Patch3: openscap-1.3.10-fix_sysctl_probe_tests-PR-2050.patch
|
||||||
|
Patch4: openscap-c99.patch
|
||||||
|
Patch5: openscap-c99-2.patch
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: cmake >= 2.6
|
BuildRequires: cmake >= 2.6
|
||||||
@ -275,6 +277,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
|||||||
%{_mandir}/man8/oscap-podman.8*
|
%{_mandir}/man8/oscap-podman.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 03 2024 Florian Weimer <fweimer@redhat.com> - 1:1.3.9-4
|
||||||
|
- Fix C compatibility issues
|
||||||
|
|
||||||
* Wed Dec 20 2023 Jan Černý <jcerny@redhat.com> - 1:1.3.9-3
|
* Wed Dec 20 2023 Jan Černý <jcerny@redhat.com> - 1:1.3.9-3
|
||||||
- Fix test test_sysctl_probe_all.sh
|
- Fix test test_sysctl_probe_all.sh
|
||||||
- Clean up the repository
|
- Clean up the repository
|
||||||
|
Loading…
Reference in New Issue
Block a user