https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85623
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- Author: msebor Date: Tue May 22 17:45:35 2018 New Revision: 260541 URL: https://gcc.gnu.org/viewcvs?rev=260541&root=gcc&view=rev Log: PR c/85623 - strncmp() warns about attribute 'nonstring' incorrectly in -Wstringop-overflow gcc/ChangeLog: PR c/85623 * calls.c (maybe_warn_nonstring_arg): Use string length to set or ajust the presumed bound on an operation to avoid unnecessary warnings. gcc/testsuite/ChangeLog: PR c/85623 * c-c++-common/attr-nonstring-3.c: Adjust. * c-c++-common/attr-nonstring-4.c: Adjust. * c-c++-common/attr-nonstring-6.c: New test. Added: trunk/gcc/testsuite/c-c++-common/attr-nonstring-6.c Modified: trunk/gcc/ChangeLog trunk/gcc/calls.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/c-c++-common/attr-nonstring-3.c trunk/gcc/testsuite/c-c++-common/attr-nonstring-4.c