http://qs1969.pair.com?node_id=11134455


in reply to Re: [OT(C)] float parameter treated as double by callee -- but it fails with FFI
in thread [OT(C)] float parameter treated as double by callee -- but it fails with FFI

Exactly, in TIFF.xs double is simply cast to float, no issues with that. My confusion was about line 337, where double is expected as argument. But, what I just found in plain Wikipedia:

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.

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:)