Current-Users archive

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

c11: FLT_DECIMAL_DIG, DBL_DECIMAL_DIG missing



Hi!

mesa 26.3.1 fails to build with

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

https://en.cppreference.com/c/header/float

says

   FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, Ldbl_DECIMAL_DIG (C11)

   conversion from float/double/long double to decimal with at least
   FLT_DECIMAL_DIG/DBL_DECIMAL_DIG/LDBL_DECIMAL_DIG digits and back is
   the identity conversion: this is the decimal precision required to
   serialize/deserialize a floating-point value (macro constant)

which I understand as "this should be defined in an C11 environment".
I also found them listed in

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf

Can someone(tm) please add them with the proper ifdefs?

Thanks,
 Thomas


Home | Main Index | Thread Index | Old Index