[Bug c++/80560] New: warn on undefined memory operations involving non-trivial types
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 28 22:16:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80560
Bug ID: 80560
Summary: warn on undefined memory operations involving
non-trivial types
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
As discussed in the review of an otherwise unrelated GCC patch
(https://gcc.gnu.org/ml/gcc-patches/2017-04/msg01506.html), calling a function
like memset to zero out an object of a non-trivial type is an easy mistake to
make, especially in C code bases that are migrating to C++. As noted in the
same discussion, projects (GDB in this instance) have developed solutions to
help detect these misuses. It would make sense for GCC to provide an option to
detect and report such errors. This is an enhancement request to track this
feature.
More information about the Gcc-bugs
mailing list