[PING^3] Wconversion: fixes for C++ front-end
Manuel López-Ibáñez
lopezibanez@gmail.com
Tue Feb 6 22:57:00 GMT 2007
On 06/02/07, Gabriel Dos Reis <gdr@cs.tamu.edu> wrote:
> On Tue, 6 Feb 2007, Manuel López-Ibáñez wrote:
>
> | I am waiting for patches to get reviewed. I hope that at least this is
> | not my fault. If I can do something to get the patches reviewed
> | faster, please, let me know.
>
>
> The bits:
>
> if (TREE_TYPE (op0) != result_type)
> - op0 = cp_convert (result_type, op0);
> - if (TREE_TYPE (op1) != result_type)
> - op1 = cp_convert (result_type, op1);
> + {
> + convert_and_check (result_type, op0);
> + op0 = cp_convert (result_type, op0);
> + }
> + if (TREE_TYPE (op1) != result_type)
> + {
> + convert_and_check (result_type, op1);
> + op1 = cp_convert (result_type, op1);
> + }
>
>
> convert op0, but throw the result away, then call cp_convert
> to convert again. That looks curious to me. Why would we want to do
> that?
Well, I would love to just use convert_and_check. But it didn't seem
to me that cp_convert was the same as the convert function invoked
from convert_and_check. (Both are defined in cp/cvt.c). So I preferred
to be on the safe side rather than experiment with my ignorance.
If you think that it is safe to replace cp_convert with convert, then
it is safe to use the return value of convert_and_check.
Thanks for looking at this,
Manuel.
More information about the Gcc-patches
mailing list