🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #4769

Bug#1154190: libpari-dev: pari.h uses sigjmp_buf, so it fails to compile with -std=c17

#4769
From: Tobias Hansen
Date: Mon, 16 Nov 2026 19:40
44 lines
3307 bytes
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
Technical Details
Message-ID: <O0aIy-cjjs-15@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod
From: Tobias Hansen <thansen@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1154190: libpari-dev: pari.h uses sigjmp_buf, so it fails to compile with -std=c17
Date: Mon, 16 Nov 2026 20:40:02 +0100
Message-ID: <O0aIy-cjjs-15@gated-at.bofh.it>
X-Original-To: submit@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 16 19:39:10 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Tobias Hansen <thansen@debian.org>, 1154190@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: ballombe@debian.org
X-Debian-Pr-Message: report 1154190
X-Debian-Pr-Package: libpari-dev
X-Debian-Pr-Source: pari
MIME-Version: 1.0
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2003037
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 44
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 16 Nov 2026 19:37:22 +0000
X-Original-Message-ID: <e33ee8c8-5ab3-4e1d-880d-e825581ab385@debian.org>