This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70389] uint_16t left shift with -Wconversion produces incorrect warning
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 06 Aug 2016 11:18:52 +0000
- Subject: [Bug c/70389] uint_16t left shift with -Wconversion produces incorrect warning
- Auto-submitted: auto-generated
- References: <bug-70389-4@http.gcc.gnu.org/bugzilla/>
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.