gcc 4.3.0, -Wconversion: assignment-by operators for shorter types

Andriy Gapon avg@icyb.net.ua
Tue May 27 18:56:00 GMT 2008


on 27/05/2008 21:48 Andrew Pinski said the following:
> On Tue, May 27, 2008 at 11:29 AM, Andriy Gapon <avg@icyb.net.ua> wrote:
>> Should I still open a new one or maybe it's better to follow up on one of
>> those two.
>>
>> And just in case, here's a better description of what I am reporting
>> (demonstration by comparison):
> The warnings with the below code is correct because of how C/C++
> define promotions.  It is ^/|/& where the warnings are not correct and
> should be solved.

Thank you for the explanation! I didn't realize the difference.

OTOH, do you think that those arithmetic warnings are practical (as 
opposed to being correct)?
I understand the rules of the language(s) but honestly I expect the same 
behavior for short and for int in expressions like those. And in cases 
where I don't expect it I'll be careful about result type anyway.


-- 
Andriy Gapon



More information about the Gcc mailing list