This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Re: conversion warnings in c++
Eric Christopher <echristo@apple.com> writes:
| >
| > -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?
yes.
| Did you want me to add this as a testcase?
yes -- so that we don't regress.
| If so, would you like
| me to check that it compiles silently by default or that -Wconversion
| turns the warnings on? :)
both :-)
Thanks!
-- Gaby