This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/80560] New: warn on undefined memory operations involving non-trivial types


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]