From 47c6375582988a3161619a7734e2651d9a6d97a824056ba86e24f1a44cc00c70 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 13 Jan 2026 21:50:14 +0100 Subject: [PATCH] Add c23.patch --- c23.patch | 31 +++++++++++++++++++++++++++++++ flint.changes | 6 ++++++ flint.spec | 4 ++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 c23.patch diff --git a/c23.patch b/c23.patch new file mode 100644 index 0000000..32afbda --- /dev/null +++ b/c23.patch @@ -0,0 +1,31 @@ +From ee516836e58327310ca58f10f71ae8873b0320e0 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky +Date: Mon, 25 Nov 2024 22:22:02 -0500 +Subject: [PATCH] src/flint.h.in: fix "noreturn" attribute in C23 mode + +C23 uses [[noreturn]] for this, just like C++. + +Signed-off-by: Michael Orlitzky +--- + src/flint.h.in | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +Index: flint-3.1.3/src/flint.h.in +=================================================================== +--- flint-3.1.3.orig/src/flint.h.in ++++ flint-3.1.3/src/flint.h.in +@@ -141,12 +141,10 @@ typedef struct __FLINT_FILE FLINT_FILE; + # define FLINT_CONSTANT_P(x) 0 + #endif + +-#if defined(__cplusplus) ++#if defined(__cplusplus) || ( __STDC_VERSION__ >= 202300L ) + # define FLINT_NORETURN [[noreturn]] +-#elif __STDC_VERSION__ < 202300L +-# define FLINT_NORETURN _Noreturn + #else +-# define FLINT_NORETURN noreturn ++# define FLINT_NORETURN _Noreturn + #endif + + #if FLINT_USES_TLS diff --git a/flint.changes b/flint.changes index c524880..9cf9d6e 100644 --- a/flint.changes +++ b/flint.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 13 20:49:03 UTC 2026 - Jan Engelhardt + +- Add c23.patch, fixing a compile error for downstream users + when using -std=c23 or a newer GCC which defaults to such. + ------------------------------------------------------------------- Wed May 8 11:32:10 UTC 2024 - Jan Engelhardt diff --git a/flint.spec b/flint.spec index c65ad88..7fd0e7a 100644 --- a/flint.spec +++ b/flint.spec @@ -28,6 +28,7 @@ URL: https://flintlib.org/ # doc/source/history.rst for changelog #Git-Clone: https://github.com/flintlib/flint Source: https://github.com/flintlib/flint/releases/download/v%version/flint-%version.tar.xz +Patch1: c23.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: fdupes @@ -107,8 +108,7 @@ done ln -s ../flint/fmpz_mpoly.h "$b/%_includedir/calcium/utils_flint.h" %fdupes %buildroot/%_prefix -%post -n %lname -p /sbin/ldconfig -%postun -n %lname -p /sbin/ldconfig +%ldconfig_scriptlets -n %lname %files -n %lname %_libdir/libflint.so.* -- 2.51.1