[Bug c++/48379] -Wdouble-promotion warns for promotion by varargs

dcrocker at eschertech dot com gcc-bugzilla@gcc.gnu.org
Tue Oct 18 14:29:32 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48379

David Crocker <dcrocker at eschertech dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcrocker at eschertech dot com

--- Comment #4 from David Crocker <dcrocker at eschertech dot com> ---
I too am getting fed up with having to add an explicit cast to double to
suppress the warning whenever I pass a float to a varargs function. I have
probably spent a few hours this year adding these casts. As has already been
said, nothing can he done about the promotion in this context, so it's not
worth warning about. Whereas in other situations, the warning is very useful to
me because I work with embedded processors that have single-precision but not
double-precision floating point hardware, so I want to avoid double precision
maths as far as possible.


More information about the Gcc-bugs mailing list