note
vr
<p>Exactly, in TIFF.xs double is simply cast to float, no issues with that. My confusion was about <a href="https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tif_dir.c#L337">line 337</a>, where double is expected as argument. But, what I just found in plain <a href="https://en.wikipedia.org/wiki/Stdarg.h">Wikipedia</a>:</p>
<blockquote>
Another consideration is the default argument promotions applied to the unnamed arguments. A float will automatically be promoted to a double. Likewise, arguments of types narrower than an int will be promoted to int or unsigned int. The function receiving the unnamed arguments must expect the promoted type.
</blockquote>
<p>That answers my question about libtiff code. And, perhaps implicitly, addresses the question about FFI: for variadic functions, promoted args types must be specified (i.e. not float, but double). OK, now I'm educated:)</p>
11134440
11134444