public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48379] New: -Wdouble-promotion warns for promotion by varargs
@ 2011-03-31  4:56 jmuizelaar at mozilla dot com
  2011-03-31 10:38 ` [Bug c++/48379] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jmuizelaar at mozilla dot com @ 2011-03-31  4:56 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: -Wdouble-promotion warns for promotion by varargs
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jmuizelaar@mozilla.com


The following program gives a warning about double promotion:

#include <stdio.h>
void
p()
{
    float q = 5;
    printf("%g\n", q);
}

Since, there's not much that can be done to fix this situation it's probably
not worth warning about. Alternatively, a switch could be added to avoid the
warning spam.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/48379] -Wdouble-promotion warns for promotion by varargs
  2011-03-31  4:56 [Bug c++/48379] New: -Wdouble-promotion warns for promotion by varargs jmuizelaar at mozilla dot com
@ 2011-03-31 10:38 ` rguenth at gcc dot gnu.org
  2013-11-23 14:15 ` achurch+gcc at achurch dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-31 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.03.31 10:04:48
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-31 10:04:48 UTC ---
I think it's working as designed.  Eventually some separate control over
whether
varargs should be warned for is useful.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/48379] -Wdouble-promotion warns for promotion by varargs
  2011-03-31  4:56 [Bug c++/48379] New: -Wdouble-promotion warns for promotion by varargs jmuizelaar at mozilla dot com
  2011-03-31 10:38 ` [Bug c++/48379] " rguenth at gcc dot gnu.org
@ 2013-11-23 14:15 ` achurch+gcc at achurch dot org
  2022-10-18 14:29 ` dcrocker at eschertech dot com
  2024-01-17 17:35 ` rlcamp.pdx at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: achurch+gcc at achurch dot org @ 2013-11-23 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Church <achurch+gcc at achurch dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |achurch+gcc at achurch dot org

--- Comment #2 from Andrew Church <achurch+gcc at achurch dot org> ---
+1 for adding an option to disable double-promotion warnings for varargs.  The
true-positive warnings are useful, but they can easily get lost in varargs spam
if you have a lot of debug logging, for example.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/48379] -Wdouble-promotion warns for promotion by varargs
  2011-03-31  4:56 [Bug c++/48379] New: -Wdouble-promotion warns for promotion by varargs jmuizelaar at mozilla dot com
  2011-03-31 10:38 ` [Bug c++/48379] " rguenth at gcc dot gnu.org
  2013-11-23 14:15 ` achurch+gcc at achurch dot org
@ 2022-10-18 14:29 ` dcrocker at eschertech dot com
  2024-01-17 17:35 ` rlcamp.pdx at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: dcrocker at eschertech dot com @ 2022-10-18 14:29 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/48379] -Wdouble-promotion warns for promotion by varargs
  2011-03-31  4:56 [Bug c++/48379] New: -Wdouble-promotion warns for promotion by varargs jmuizelaar at mozilla dot com
                   ` (2 preceding siblings ...)
  2022-10-18 14:29 ` dcrocker at eschertech dot com
@ 2024-01-17 17:35 ` rlcamp.pdx at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: rlcamp.pdx at gmail dot com @ 2024-01-17 17:35 UTC (permalink / raw)
  To: gcc-bugs

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

Campbell <rlcamp.pdx at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rlcamp.pdx at gmail dot com

--- Comment #5 from Campbell <rlcamp.pdx at gmail dot com> ---
I second everything said here - this is still annoying and significantly
increases the noise level when looking for legitimate actionable warnings, when
it is not itself actionable other than by adding an explicit cast to silence
it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-17 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31  4:56 [Bug c++/48379] New: -Wdouble-promotion warns for promotion by varargs jmuizelaar at mozilla dot com
2011-03-31 10:38 ` [Bug c++/48379] " rguenth at gcc dot gnu.org
2013-11-23 14:15 ` achurch+gcc at achurch dot org
2022-10-18 14:29 ` dcrocker at eschertech dot com
2024-01-17 17:35 ` rlcamp.pdx at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).