https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81327

--- Comment #16 from Martin Sebor <msebor at gcc dot gnu.org> ---
The GCC warning detects several distinct kinds of undefined behavior, most of
which cannot very well be made well-defined.  Making changes to the checker
just because a subset of the undefined cases are viewed as less severe than
another, or with the expectation that a future standard might make that subset
well-defined, would increase the risk of missing the more severe ones.

I wouldn't be opposed to moving the Clang -Wdynamic-class-memaccess subset of
the the warning under its own option in GCC and having that one enabled in
-Wextra rather than -Wall, but I don't support removing the warning in its
entirety from -Wall just to accommodate undefined code in legacy versions of a
single library.

The established way of dealing with new warnings in supported versions of
libraries is to fix the libraries (either by actually removing the problem or
by adding suppression mechanisms).  It's understood that unsupported/legacy
versions of software may not compile cleanly with new versions of compilers and
that some new warnings may need to be disabled.

Reply via email to