conversion warnings in c++

Eric Christopher echristo@apple.com
Thu Jan 12 01:35:00 GMT 2006


So, for calls in c++ we're warning unconditionally on something like:

int bar (int a, int b);

int main (void)
{
   float foo = 5.0;
   float baz = 10.0;

   bar (foo, baz);

   return 0;
}

int bar (int a, int b)
{
   return a + b;
}

whereas in C we're warning depending on Wtraditional or Wconversion.  
As far as I can tell there's no required diagnostic for this in C++,  
though I could have missed it.

So, either a) did I miss something? or b) any objections to  
conditionalizing the warnings on Wconversion (or some method of  
turning them off)?

-eric



More information about the Gcc mailing list