https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112377
Bug ID: 112377
Summary: Implement -Walloc-size in c++
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
Following on from discussion in bug report 112347,
in file gcc/c-family/c.opt, is the new text
Walloc-size
C ObjC Var(warn_alloc_size) Warning LangEnabledBy(C ObjC, Wextra)
Warn when allocating insufficient storage for the target type of the assigned
pointer.
IMHO, it should say:
Walloc-size
C ObjC Var(warn_alloc_size) Warning LangEnabledBy(C ObjC C++, Wextra)
Warn when allocating insufficient storage for the target type of the assigned
pointer.
I think that should be enough to implement the new warning for C++.