This is the mail archive of the gcc-bugs@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]

[Bug c/70389] uint_16t left shift with -Wconversion produces incorrect warning


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70389

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> > (But somehow "x++" just increments the short unsigned int x with no such
> > implicit conversion, and so does not trigger the same -Wconversion error.)
> 
> it does have an implicit conversion but it is assumed you understand there
> will always be a conversion and truncation happening.

I don't understand why this is not true of x+=1 then, or any op= for that
matter including  x<<=1U.

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