https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118720
--- Comment #7 from Daniel Green ---
(In reply to Jonathan Wakely from comment #6)
> std::span should diagnose it with -fhardened
I couldn't get `-fhardened` to complain either on godbolt or locally (with gcc
14.2.0). I tried `-O0`, `-O1`, `-O3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118720
--- Comment #2 from Daniel Green ---
(In reply to Andrew Pinski from comment #1)
> Created attachment 60347 [details]
> testcase
>
> Next time don't just link to godbolt but either attach the testcase or put
> it inline.
Ah, sorry, I thought a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118720
--- Comment #4 from Daniel Green ---
(In reply to Andrew Pinski from comment #3)
> b -= n < (uint32_t)(10);
>
> Can produce undefined behavior. because now you are doing `work-1` which is
> before the array.
>
> ```
> static constexpr void
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118720
Bug ID: 118720
Summary: Bug with unsigned ints
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118720
--- Comment #9 from Daniel Green ---
Sorry for bringing this up again, but here is a comment by the guy who
originally created the code (full thread here
https://github.com/jeaiii/itoa/issues/17#issuecomment-2652085888) and another
example (http
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118720
--- Comment #10 from Daniel Green ---
Created attachment 60467
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60467&action=edit
Second testcase