Ping: https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01698.html

On 05/29/2018 08:57 PM, Martin Sebor wrote:
Warning for a strncpy call whose bound is the same as the size
of the source and suggesting to use the size of the source is
less than helpful when both sizes are the same, as in:

  char a[4], b[4];
  strncpy (a, b, sizeof b);

The attached patch suppresses the -Wsizeof-pointer-memaccess
warning for these cases.  To do that even for VLAs (in some
cases), the patch enhances operand_equal_p() to handle
SAVE_EXPR to detect when VLA in sizeof VLA refers to the size
of a variable-length array.

Is this okay for trunk and GCC 8?

Martin

Reply via email to