NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/61107: c11: FLT_DECIMAL_DIG and DECIMAL_DIG



>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
>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.

>Unformatted:
 	
 	



Home | Main Index | Thread Index | Old Index