[Bug middle-end/85602] -Wsizeof-pointer-memaccess for strncat with size of source
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 18 17:21:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85602
--- Comment #14 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Wed Jul 18 17:20:05 2018
New Revision: 262859
URL: https://gcc.gnu.org/viewcvs?rev=262859&root=gcc&view=rev
Log:
Backport from trunk.
PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of
source
gcc/c-family/ChangeLog:
PR middle-end/85602
* c-warn.c (sizeof_pointer_memaccess_warning): Check for attribute
nonstring.
gcc/ChangeLog:
PR middle-end/85602
* calls.c (maybe_warn_nonstring_arg): Handle strncat.
* tree-ssa-strlen.c (is_strlen_related_p): Make extern.
Handle integer subtraction.
(maybe_diag_stxncpy_trunc): Handle nonstring source arguments.
* tree-ssa-strlen.h (is_strlen_related_p): Declare.
* doc/invoke.texi (-Wstringop-truncation): Update.
gcc/testsuite/ChangeLog:
PR middle-end/85602
* gcc.dg/attr-nonstring-2.c: Adjust text of expected warning.
* c-c++-common/attr-nonstring-8.c: New test.
Added:
branches/gcc-8-branch/gcc/testsuite/c-c++-common/attr-nonstring-8.c
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/c-family/ChangeLog
branches/gcc-8-branch/gcc/c-family/c-warn.c
branches/gcc-8-branch/gcc/calls.c
branches/gcc-8-branch/gcc/doc/invoke.texi
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/gcc/tree-ssa-strlen.c
branches/gcc-8-branch/gcc/tree-ssa-strlen.h
More information about the Gcc-bugs
mailing list