Add c23.patch #1

Manually merged
jengelh merged 1 commits from jengelh/flint:leap-16.0 into leap-16.0 2026-01-15 18:51:57 +01:00
3 changed files with 39 additions and 2 deletions

31
c23.patch Normal file
View File

@@ -0,0 +1,31 @@
From ee516836e58327310ca58f10f71ae8873b0320e0 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
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 <michael@orlitzky.com>
---
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

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 13 20:49:03 UTC 2026 - Jan Engelhardt <jengelh@inai.de>
- 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 <jengelh@inai.de>

View File

@@ -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.*