This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 40752: -Wconversion generates false warnings for operands not larger than target type


Hi,

On 06/11/2010 10:23 PM, Manuel López-Ibáñez wrote:
On 11 August 2009 02:01, Joseph S. Myers<joseph@codesourcery.com> wrote:
On Tue, 11 Aug 2009, Manuel López-Ibáñez wrote:

Modified the patch to make use of the new c-c++-common testsuite.
Bootstrapped and regression tested on x86_64-linux-gnu.

OK for trunk?
I still think the warnings for these cases are mostly correct (there are
cases where you may be able to make deductions about the range of possible
values of the expression being converted) and appropriate, and if disabled
should be disabled under some separate -Wno-conversion-whatever option.
-Wno-conversion-after-promotion ?

I am not sure what would be a good name, but I think it is worth to
allow silencing these warnings, so suggestions are welcome.
it looks like this PR is still open today, and I think resolving it one way or the other isn't much work... Thus I'm asking: shall we actually have a new -Wno-conversion-after-promotion? Or, alternately - the issue came up quite often in recent times, because other widespread compilers don't warn - suppress the warning only in case of conditional expressions:

char
foo(bool haveBar, char bar_)
{
  return haveBar ? bar_ : 0;
};

What do you think?

Thanks,
Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]