This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-Wdouble-promotion & noise
- From: tbp <tbptbp at gmail dot com>
- To: GCC <gcc at gcc dot gnu dot org>
- Date: Tue, 14 Sep 2010 16:30:09 +0200
- Subject: -Wdouble-promotion & noise
Hello,
I could really use -Wdouble-promotion but, atm, it appears quite impractical,
$ cat double.cc
#include <cstdio>
void foo(...);
int main() {
float f = 1;
foo(f);
printf("%f", f);
}
$ /usr/local/gcc-4.6-20100913/bin/g++ -Wdouble-promotion double.cc
double.cc: In function 'int main()':
double.cc:5:7: warning: implicit conversion from 'float' to 'double'
when passing argument to function [-Wdouble-promotion]
double.cc:6:16: warning: implicit conversion from 'float' to 'double'
when passing argument to function [-Wdouble-promotion]
... and the interesting bits are lost in the noise. I can't think of a
workaround.
So i have to ask: Is that how it's meant to be, or simply a temporary
shortcoming? Have i missed an obvious kludge?