https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Target Milestone|--- |11.0
Priority|P3 |P2
Keywords| |alias
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot
gnu.org
--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
Bumping up Priority to 2 since this is causing Fedora build failures (with
-Werror) in a number of packages. I can't think of a better near term
fix/workaround (for GCC 11) than to revert the change enabling the
-Wstringop-xxx warnings for memcpy/memmove calls in system headers inlined into
user code. This won't eliminate the warning completely, just suppress it when
-Wno-system-headers is in effect (which is by default), and restore things to
their pre-GCC 11 status.
My idea for a longer term solution is to add some source-level annotation to
containers like std::string to either let GCC eliminate the unreachable code
altogether, or let the warning determine the code is, in fact, unreachable.
For reference, here's a brief exchange we had on this subject:
https://gcc.gnu.org/pipermail/gcc/2021-January/234641.html