[PATCH] Re: conversion warnings in c++

Eric Christopher echristo@apple.com
Thu Jan 12 22:48:00 GMT 2006


>
> -Wconversion is a good idea.  I don't think -Wtraditional is relevant.

Here's the patch to implement it. Avoids the warning in this testcase  
when -Wconversion is not passed on the command line:

int func1(int i)
{
   return i;
}

int main()
{
   float f;
   long l;
   unsigned long ul;

   f = 1.5f;

   l = f;
   ul = -1;
   func1(f);

   return 0;
}


OK? Did you want me to add this as a testcase? If so, would you like  
me to check that it compiles silently by default or that -Wconversion  
turns the warnings on? :)

-eric

2006-01-12  Eric Christopher  <echristo@apple.com>

         * call.c (convert_like_real): When issuing conversion
         warnings, depend on OPT_Wconversion.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: warning.diff.txt
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20060112/cb31b429/attachment.txt>


More information about the Gcc mailing list