NetBSD Problem Report #61107

From wiz@netbsd.org  Tue Dec  1 16:04:40 2026
Return-Path: <wiz@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id F14AF1A923B
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 Dec 2026 16:04:39 +0000 (UTC)
Message-Id: <20261201160439.8C2C384CE6@mail.netbsd.org>
Date: Tue,  1 Dec 2026 16:04:39 +0000 (UTC)
From: wiz@NetBSD.org
Reply-To: wiz@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: c11: FLT_DECIMAL_DIG and DECIMAL_DIG
X-Send-Pr-Version: 3.95
X-From4GNATS: "wiz@NetBSD.org via gnats" <gnats-admin@NetBSD.org>

>Number:         61107
>Category:       lib
>Synopsis:       c11: missing FLT_DECIMAL_DIG and DECIMAL_DIG
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 01 16:05:00 +0000 2026
>Last-Modified:  Tue Dec 01 16:40:03 +0000 2026
>Originator:     Thomas Klausner
>Release:        NetBSD 11.99.11
>Organization:

>Environment:


Architecture: x86_64
Machine: amd64
>Description:
mesa wants to use two constants promised by the c11 standard, but NetBSD
does not provide them, leading to

../src/intel/compiler/brw/brw_print.cpp: In function 'void brw_print_instruction(const brw_shader&, const brw_inst*, FILE*, const brw_def_analysis*)':
../src/intel/compiler/brw/brw_print.cpp:602:40: error: 'FLT_DECIMAL_DIG' was not declared in this scope; did you mean 'DECIMAL_DIG'?
  602 |                fprintf(file, "%.*g:F", FLT_DECIMAL_DIG, inst->src[i].f);
      |                                        ^~~~~~~~~~~~~~~
      |                                        DECIMAL_DIG
../src/intel/compiler/brw/brw_print.cpp:610:41: error: 'DBL_DECIMAL_DIG' was not declared in this scope; did you mean 'DECIMAL_DIG'?
  610 |                fprintf(file, "%.*g:DF", DBL_DECIMAL_DIG, inst->src[i].df);
      |                                         ^~~~~~~~~~~~~~~
      |                                         DECIMAL_DIG


See also
https://en.cppreference.com/c/header/float
and
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf
section 5.2.4.2.2

(If you're especially motivated, my guess is that more is missing
from that section.

>How-To-Repeat:
cd /usr/pkgsrc/graphics/mesa
rm patches/patch-src_intel_compiler_brw_brw__print.cpp
make

>Fix:
Add the constants with the appropriate guards.

>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61107 CVS commit: src/sys/sys
Date: Tue, 1 Dec 2026 16:37:45 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Dec  1 16:37:45 UTC 2026

 Modified Files:
 	src/sys/sys: float_ieee754.h

 Log Message:
 float.h (ieee754): Add C11/POSIX.1-2024 additions.

 Simplify feature tests while here:

 - If none of _ANSI_SOURCE, _POSIX_C_SOURCE, and _XOPEN_SOURCE is
   defined, then _NETBSD_SOURCE is defined.
 - _XOPEN_SOURCE >= 600 implies _POSIX_C_SOURCE >= 200112L.

 PR lib/61107: c11: missing FLT_DECIMAL_DIG and DECIMAL_DIG


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/sys/sys/float_ieee754.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/61107 CVS commit: src/sys/arch/vax/include
Date: Tue, 1 Dec 2026 16:37:59 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Tue Dec  1 16:37:59 UTC 2026

 Modified Files:
 	src/sys/arch/vax/include: float.h

 Log Message:
 float.h (vax): Add C11/POSIX.1-2024 additions.

 Simplify feature tests while here:

 - If none of _ANSI_SOURCE, _POSIX_C_SOURCE, and _XOPEN_SOURCE is
   defined, then _NETBSD_SOURCE is defined.
 - _XOPEN_SOURCE >= 600 implies _POSIX_C_SOURCE >= 200112L.

 PR lib/61107: c11: missing FLT_DECIMAL_DIG and DECIMAL_DIG


 To generate a diff of this commit:
 cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/include/float.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.