🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#4886
From: Bill Allombert
Date: Tue, 17 Nov 2026 21:40
45 lines
3505 bytes
On Mon, Nov 16, 2026 at 09:28:23PM +0100, Bill Allombert wrote:
> On Mon, Nov 16, 2026 at 07:37:22PM +0000, Tobias Hansen wrote:
> > 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:
> 
> Hello Tobias,
> 
> Note that using the PARI headers without __GNUC__ defined can lead to significant
> performance loss since that disables inline assembly, so it is not something we
> should encourage. I would consider building a Debian package this way to be a bug.

However it seems that using -std=c17 does not actually disable __GNUC__ so this is
not an issue here. 

> That aside, if you want to use -std=c17, I suggest you also add -D_POSIX_C_SOURCE
> Probably this problem could be fixed by adding #define _POSIX_C_SOURCE in pari.h

Indeed adding to pari.h the following fix the issue.

#  ifndef _POSIX_C_SOURCE
#    define _POSIX_C_SOURCE 1
#  endif

However, I am still unsure it is make sens to set -std=c17 without also setting _POSIX_C_SOURCE
to something. Sure the C code can do it for you but then, why using -std=c17 in the first place ?

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,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 
Technical Details
Message-ID: <O0z4d-cwQC-7@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <O0aIy-cjjs-15@gated-at.bofh.it> <O0buV-cjLO-7@gated-at.bofh.it> <O0aIy-cjjs-15@gated-at.bofh.it> <O0buV-cjLO-7@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.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: Tue, 17 Nov 2026 22:40:01 +0100
Message-ID: <O0z4d-cwQC-7@gated-at.bofh.it>
References: <O0aIy-cjjs-15@gated-at.bofh.it> <O0buV-cjLO-7@gated-at.bofh.it> <O0aIy-cjjs-15@gated-at.bofh.it> <O0buV-cjLO-7@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Tue Nov 17 21:35:09 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/2003198
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 45
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 17 Nov 2026 22:32:28 +0100
X-Original-Message-ID: <avzH7DlezBwSs4ux@seventeen>
X-Original-References: <e33ee8c8-5ab3-4e1d-880d-e825581ab385@debian.org> <avtnZPFKG_YTPEve@seventeen> <e33ee8c8-5ab3-4e1d-880d-e825581ab385@debian.org> <avtnZPFKG_YTPEve@seventeen>