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