[Mesa-dev] [PATCH 00/13] Avoid double promotion

Daniel Stone daniel at fooishbar.org
Tue Jul 14 04:32:26 PDT 2015


Hi,

On 14 July 2015 at 00:22, Matt Turner <mattst88 at gmail.com> wrote:
but it's not really
> useful in general because float arguments are always cast to double
> when passed as arguments to varargs functions like printf (why?), and
> it warns about that, generating a lot of noise.

It might shock you to learn that the answer is awful historical
reasons. Or maybe not.

Some types undergo unconditional promotion, similar to pre-prototype
functions, when used in vararg calls: float is promoted to double, and
char/short are promoted to int.

http://c-faq.com/~scs/cgi-bin/faqcat.cgi?sec=ansi#argpromos

Cheers,
Daniel


More information about the mesa-dev mailing list