This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/79366] wrong result in cast to unsigned int
- From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 04 Feb 2017 06:57:21 +0000
- Subject: [Bug target/79366] wrong result in cast to unsigned int
- Auto-submitted: auto-generated
- References: <bug-79366-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79366
--- Comment #8 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Jakub Jelinek from comment #7)
> (In reply to Jonathan Wakely from comment #3)
> > Clang's ubsan diagnoses this, but ours doesn't:
> >
> > u.cc:4:25: runtime error: value -1 is outside the range of representable
> > values of type 'unsigned int'
>
> We do diagnose it as well, but only with -fsanitize=float-cast-overflow,
> which is intentionally not included in -fsanitize=undefined.
Oh really.
And what was the rationale behind that decision?