https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118720
--- Comment #7 from Daniel Green <ddgreen at gmail dot com> --- (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`, and also explicitly putting `-D_FORTIFY_SOURCE=3`, and `-D_FORTIFY_SOURCE=0`. I always got `warning: ‘_FORTIFY_SOURCE’ is not enabled by ‘-fhardened’ because it was specified in ‘-D’ or ‘-U’ [-Whardened]`, but no complaints at compile or runtime about the code.