This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/85802] false-positive -Wmemset-elt-size when compiling C++ code
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 May 2018 10:25:52 +0000
- Subject: [Bug c++/85802] false-positive -Wmemset-elt-size when compiling C++ code
- Auto-submitted: auto-generated
- References: <bug-85802-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85802
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Try adding sizeof (char*) instead.
Note the reason why it does not complain in c is because buf is a vla in c
while is a standard array in c++. Const is treated differently in the
languages.