Commit 3a03bffd by Martin Sebor Committed by Jeff Law

tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Avoid undesirable warning.

	* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Avoid
	undesirable warning.

From-SVN: r267454
parent 766d4a59
2018-12-28 Martin Sebor <msebor@redhat.com>
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Avoid
undesirable warning.
2018-12-28 Thomas Schwinge <thomas@codesourcery.com>
* omp-expand.c (expand_omp_target): Restructure OpenACC vs. OpenMP
......@@ -2114,6 +2114,13 @@ maybe_diag_stxncpy_trunc (gimple_stmt_iterator gsi, tree src, tree cnt)
if (wi::to_wide (dstsize) != cntrange[1])
return false;
/* Avoid warning for strncpy(a, b, N) calls where the following
equalities hold:
N == sizeof a && N == sizeof b */
if (tree srcsize = compute_objsize (src, 1))
if (wi::to_wide (srcsize) == cntrange[1])
return false;
if (cntrange[0] == cntrange[1])
return warning_at (callloc, OPT_Wstringop_truncation,
"%G%qD specified bound %E equals destination size",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment