@cImport Fails with gmp_sprintf for mpfr_t Variadic Args #23009
Labels
bug
Observed behavior contradicts documented or intended behavior
translate-c
C to Zig source translation feature (@cImport)
Zig Version
0.14.0-dev.3222+8a3aebaee:
Steps to Reproduce and Observed Behavior
Description
In Zig 0.14.0,
gmp_sprintf
via@cImport
fails to formatmpfr_t
arguments (from MPC) with%Rf
, outputting the format string (%Rf
, 3 chars) instead of the value. It works correctly withmpf_t
(GMP) and%Ff
.Steps to Reproduce
libgmp-dev
,libmpfr-dev
,libmpc-dev
on Ubuntu.demo.zig
andbuild.zig
.zig build run --verbose
.Observed Behavior
mpf_t: 3.141589999999999882618340052431449294090270996093, wrote: 52 mpfr_t: %Rf, wrote: 3
mpf_t
works as expected.mpfr_t
outputs%Rf
instead of the value.Environment
Expected Behavior
Expected Behavior
mpf_t
: Formats as3.14159...
(GMP float).mpfr_t
: Formats as2.718...
(MPFR float from MPC).bug_demo.zip
The text was updated successfully, but these errors were encountered: