[Bug c++/85802] false-positive -Wmemset-elt-size when compiling C++ code

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 16 10:25:00 GMT 2018


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.


More information about the Gcc-bugs mailing list