This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70378] wrong warning with -Wconversion with explicit cast
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Feb 2018 10:34:39 +0000
- Subject: [Bug c/70378] wrong warning with -Wconversion with explicit cast
- Auto-submitted: auto-generated
- References: <bug-70378-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70378
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=70336
--- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #3)
> (In reply to Manuel López-Ibáñez from comment #2)
> > Simpler testcase:
> >
> > typedef unsigned int uint32_t;
> > void foo(char a, uint32_t b)
> > {
> > b = (uint32_t)((b * 10) + (uint32_t)a);
> > }
> >
> > Something must be removing the explicit cast or messing up the expression.
>
> Perhaps a duplicate of PR70336. It seems that the move to match.pd just
> added more early folding that removes explicit casts.
70336 was fixed, though, and I still get a warning for this testcase...