On Tue, Sep 14, 2010 at 8:44 PM, Ian Lance Taylor <i...@google.com> wrote:
> Let me put it a different way: what is it that you want, expressed in
> terms of C/C++ code?  What should the compiler be warning about?
Hmm. I think the provided example captures most of what i care about,
  float area(float radius) { return 3.14159 * radius * radius; }
and even forgotten/disguised uses of, say, M_PI, would fall in that
category after-all.

>>   -Wunsuffixed-float-constants, unavailable in C++.
> It seems that this could be added to C++ easily enough.
If i'm not mistaken (i've never put it to real use)
-Wunsuffixed-float-constants would handle that. So, it wouldn't be as
airtight as -Wdouble-promotion but still good enough and a fantastic
improvement.

Reply via email to