🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#4776
From: Bill Allombert
Date: Mon, 16 Nov 2026 21:20
50 lines
3826 bytes
On Mon, Nov 16, 2026 at 08:28:32PM +0000, John Scott wrote:
> Tobias Hansen wrote:
> > 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?
> 
> I have some thoughts: currently the problematic part of the header is
> struct gp_context {
> 	…
> 	sigjmp_buf *iferr_env;
> 	…
> };
> 
> Note that the types sigjmp_buf and jmp_buf are not interchangeable,

In both glibc and musl we have

glibc:
/* Use the same type for `jmp_buf' and `sigjmp_buf'.
   The `__mask_was_saved' flag determines whether
   or not `longjmp' will restore the signal mask.  */
typedef struct __jmp_buf_tag sigjmp_buf[1];

musl:
typedef jmp_buf sigjmp_buf;

so it is not a ABI break.

Windows is handled by  #if !defined(HAS_SIGSETJMP)

> I also want to point out this note in the bug submitter's initial patch at
> https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2715
> > /* Darwin longjmp restores signal masks with sigprocmask, which changes the
> > masks of all threads.

> I don't believe this is POSIX-conforming behavior: although the POSIX
> language isn't totally crystal clear, the signal mask is a per-thread
> attribute, and I don't think setjmp()/longjmp()'s minimally-specified
> behavior with respect to signal masks is intended to permit mangling the
> signal masks of *other unrelated threads*. This broken behavior ought to be
> fixed if it really is present, by switching to pthread_sigmask() in its
> longjmp() implementation or similar.

Good luck getting macos to fix their pthread bugs...

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 
Technical Details
Message-ID: <O0chj-ckfh-13@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod
References: <O0aIy-cjjs-15@gated-at.bofh.it> <O0aIy-cjjs-15@gated-at.bofh.it> <O0chj-ckfh-15@gated-at.bofh.it> <O0aIy-cjjs-15@gated-at.bofh.it> <O0chj-ckfh-15@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From: Bill Allombert <ballombe@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 22:20:01 +0100
Message-ID: <O0chj-ckfh-13@gated-at.bofh.it>
References: <O0aIy-cjjs-15@gated-at.bofh.it> <O0aIy-cjjs-15@gated-at.bofh.it> <O0chj-ckfh-15@gated-at.bofh.it> <O0aIy-cjjs-15@gated-at.bofh.it> <O0chj-ckfh-15@gated-at.bofh.it>
X-Original-To: John Scott <jscott@posteo.net>, 1154190@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 16 21:17:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: Bill Allombert <ballombe@debian.org>, 1154190@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: ballombe@debian.org
X-Debian-Pr-Message: followup 1154190
X-Debian-Pr-Package: libpari-dev
X-Debian-Pr-Source: pari
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-Debian-User: ballombe
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2003050
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 50
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: Tobias Hansen <thansen@debian.org>
X-Original-Date: Mon, 16 Nov 2026 22:15:06 +0100
X-Original-Message-ID: <avtyWjeisVox_xoe@seventeen>
X-Original-References: <e33ee8c8-5ab3-4e1d-880d-e825581ab385@debian.org> <e33ee8c8-5ab3-4e1d-880d-e825581ab385@debian.org> <2c899c3a1739e52708c3cabc8943d4f0b837df0b.camel@posteo.net> <e33ee8c8-5ab3-4e1d-880d-e825581ab385@debian.org> <2c899c3a1739e52708c3cabc8943d4f0b837df0b.camel@posteo.net>