This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80560] New: warn on undefined memory operations involving non-trivial types
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Apr 2017 22:16:04 +0000
- Subject: [Bug c++/80560] New: warn on undefined memory operations involving non-trivial types
- Auto-submitted: auto-generated
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.