Your message dated Sun, 22 Nov 2026 14:53:33 +0100
with message-id <awLz3R0OtgHNAEZy@seventeen>
and subject line Re: Bug#1154190: libpari-dev: pari.h uses sigjmp_buf, so it
fails to compile with -std=c17
has caused the Debian Bug report #1154190,
regarding libpari-dev: pari.h uses sigjmp_buf, so it fails to compile with
-std=c17
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1154190: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1154190
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libpari-dev
Version: 2.19.1-1
Severity: important
Affects: src:sagemath
Dear Maintainer,
since 2.19.1-1, the public PARI headers cannot be compiled in strict ISO C
mode (-std=c99/c11/c17), because they use the POSIX type sigjmp_buf, which
glibc's <setjmp.h> only declares when POSIX features are enabled:
In file included from /usr/include/x86_64-linux-gnu/pari/pari.h:42,
from testfile.c:2:
/usr/include/x86_64-linux-gnu/pari/paristio.h:206:3: error: unknown type name
'sigjmp_buf'; did you mean 'jmp_buf'?
206 | sigjmp_buf *iferr_env;
| ^~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/pari/pari.h:43:
/usr/include/x86_64-linux-gnu/pari/paricom.h:42:15: error: unknown type name
'sigjmp_buf'; did you mean 'jmp_buf'?
42 | extern THREAD sigjmp_buf *iferr_env;
| ^~~~~~~~~~
Minimal reproducer:
$ cat t.c
#include <pari/pari.h>
int main(void) { pari_init(1000000, 2); pari_close(); return 0; }
$ gcc -std=c17 t.c -lpari # fails as above
$ gcc -std=gnu17 t.c -lpari # works
This breaks the build of sagemath, which compiles its C code with
-std=c17: its configure-time PARI version check fails, and so would the
Cython-generated C modules that include pari.h. sagemath built fine
against 2.19.0-1 with the same flags. C++ users are not affected, as g++
always defines _GNU_SOURCE.
A library header can't rely on the user enabling POSIX features. Could
the headers keep using jmp_buf in the public declarations, or otherwise
avoid requiring sigjmp_buf to be visible, so that pari.h works again with
strict ISO C compilers?
In sagemath I have worked around it for now by building with -std=gnu17.
Best,
Tobias
--- End Message ---
--- Begin Message ---
On Tue, Nov 17, 2026 at 10:03:49PM +0000, Tobias Hansen wrote:
> > For example from feature_test_macros(7)
> >
> > _POSIX_C_SOURCE
> > Defining this macro causes header files to expose
> > definitions as follows:
> > • The value 1 exposes definitions conforming to
> > POSIX.1-1990 and ISO C (1990).
> >
> > Cheers,
>
> Hi,
>
> I don't know why sagemath uses -std=c17. Maybe they just didn't have a reason
> not to use it until now.
I have convinced myself that this problem cannot be fixed in a robust way.
libpari is built (at Configure time) for a POSIX system, the headers will not
work on
non-POSIX system.
So if you set -std=c17, you must also set -D_POSIX_C_SOURCE
This cannot be done by the PARI headers because _POSIX_C_SOURCE
need to be set before /usr/include/features.h is read, which means before any
system header is read, and there is no reason for pari.h to be included first.
(features.h has #ifndef _FEATURES_H to prevent to be read twice, and the same
for setjmp.h)
Note that the recommended CFLAGS to build PARI modules are available in
/usr/lib/x86_64-linux-gnu/pari/pari.cfg
and are used by gp2c for example.
Closing this report, tahnks for your work on sagemath packaging.
Cheers,
--
Bill. <[email protected]>
Imagine a large red swirl here.
--- End Message ---