From 3b5757ea87ad2274b841340335bf7536204e615b Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Thu, 16 Jan 2020 10:41:44 +0100 Subject: [PATCH] Work around array out of bounds warning in mkdeps MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This suppresses an array out of bounds warning in mkdeps.c as proposed by Martin Sebor in the bugzilla. array subscript 2 is outside array bounds of ‘const char [2]’ Since this warning does occur during bootstrap it currently breaks werror builds on IBM Z. The problem can be reproduced also on x86_64 by changing the inlining threshold using: --param max-inline-insns-auto=80 Bootstrapped and regression tested on x86_64 and IBM Z. libcpp/ChangeLog: 2020-01-16 Andreas Krebbel PR tree-optimization/92176 * mkdeps.c (deps_add_default_target): Avoid calling apply_vpath to suppress an array out of bounds warning. --- libcpp/mkdeps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpp/mkdeps.c b/libcpp/mkdeps.c index 6b2575a2709..09a111fcdd5 100644 --- a/libcpp/mkdeps.c +++ b/libcpp/mkdeps.c @@ -268,7 +268,7 @@ deps_add_default_target (class mkdeps *d, const char *tgt) return; if (tgt[0] == '\0') - deps_add_target (d, "-", 1); + d->targets.push (xstrdup ("-")); else { #ifndef TARGET_OBJECT_SUFFIX -- 2.30.2