From f35612dc800be8ab79b73f049691f8f627e15818 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 17 Apr 2023 14:22:40 +0200 Subject: [PATCH] Backport upstream patch to fix C99 compatibility issue Related to: --- Singular-c99.patch | 41 +++++++++++++++++++++++++++++++++++++++++ Singular.spec | 6 +++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Singular-c99.patch diff --git a/Singular-c99.patch b/Singular-c99.patch new file mode 100644 index 0000000..f238862 --- /dev/null +++ b/Singular-c99.patch @@ -0,0 +1,41 @@ +commit b6647a741b9091b82021ff46d4c112099d175d57 +Author: Michael Orlitzky +Date: Thu Nov 10 20:59:00 2022 -0500 + + omalloc/omAllocSystem.c: add another include for malloc.h. + + There are two branches in this file, one for HAVE_MALLOC_SIZE and one + for HAVE_MALLOC_USABLE_SIZE. The former includes malloc.h, and the + latter needs to too; otherwise, malloc_usable_size() is undefined. + + This is caught by -Werror=implicit-function-declaration, which is + likely to be enabled by default in future versions of GCC and clang. + +diff --git a/omalloc/omAllocSystem.c b/omalloc/omAllocSystem.c +index b70a6292acf8ed80..62e20a57b8b53472 100644 +--- a/omalloc/omAllocSystem.c ++++ b/omalloc/omAllocSystem.c +@@ -30,15 +30,19 @@ + * + *******************************************************************/ + /* allocation of large addr */ +-#if defined(HAVE_MALLOC_SIZE) ++ ++#if defined(HAVE_MALLOC_SIZE) || defined(HAVE_MALLOC_USABLE_SIZE) ++ #include + #ifdef HAVE_MALLOC_H +- #include ++ #include + #elif defined(HAVE_MALLOC_MALLOC_H) +- #include ++ #include + #endif ++#endif ++ ++#if defined(HAVE_MALLOC_SIZE) + #define _omSizeOfLargeAddr(addr) (malloc_size(addr)) + #elif defined(HAVE_MALLOC_USABLE_SIZE) +- #include + #define _omSizeOfLargeAddr(addr) (malloc_usable_size(addr)) + #else + void* omAllocLarge(size_t size) diff --git a/Singular.spec b/Singular.spec index 604578d..f1d751f 100644 --- a/Singular.spec +++ b/Singular.spec @@ -16,7 +16,7 @@ Name: Singular Version: %{downstreamver}%{?patchver} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Computer Algebra System for polynomial computations # License analysis: # - The project as a whole is GPL-2.0-only OR GPL-3.0-only @@ -123,6 +123,7 @@ Patch12: %{name}-type-mismatch.patch Patch13: %{name}-endian.patch # Disable examples that use the network to avoid hangs on the koji builders Patch14: %{name}-doc-hang.patch +Patch15: Singular-c99.patch %description Singular is a computer algebra system for polynomial computations, with @@ -457,6 +458,9 @@ make check %changelog +* Mon Apr 17 2023 Florian Weimer - 4.3.1p1-3 +- Backport upstream patch to fix C99 compatibility issue + * Wed Jan 18 2023 Fedora Release Engineering - 4.3.1p1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild