This is the mail archive of the gcc@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: gcc 4.3.0, -Wconversion: assignment-by operators for shorter types


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


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