From patchwork Mon Sep 30 23:31:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 34752 Received: (qmail 98550 invoked by alias); 30 Sep 2019 23:31:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 98542 invoked by uid 89); 30 Sep 2019 23:31:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:startup, H*MI:google X-HELO: mail-pf1-f201.google.com Received: from mail-pf1-f201.google.com (HELO mail-pf1-f201.google.com) (209.85.210.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Sep 2019 23:31:23 +0000 Received: by mail-pf1-f201.google.com with SMTP id i28so8912977pfq.16 for ; Mon, 30 Sep 2019 16:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=VC+QOzUT44Ten9rgpv3JquUW31bo/BYhlF2UH9LWe2o=; b=jLiIM1nxkJNf2+OCpcIPAP6YoIrtcmMjuRQSHOd2g+jzXZunHMdOS9XXGtRZi2sesl hZdDJqKFhLrxjC/P54pjaJvObWvBkjbKa+5AhX5rwM6+HEbDlmdLJW8O63qbQamhbXdZ YvigSgYhWXXo4UmMqrmIrXDkszjvSUmxQ/p69hHVxwRwLEHnmV8NQCWyBwLg8sekhnOz 0isVNtXwsNsh6aD2v/kKT5W1jgXD+cJcC7OtolqMK2ruY4HcUZb7B8kRtrNoGJJHhnBx qarrrPRGmM1ZIRwLtEBO4FTdiz2vA0csWLS+YCrfHTQlw3RPM/NMg09HprbX1x8fkT9U NiTA== Date: Mon, 30 Sep 2019 18:31:07 -0500 Message-Id: <20190930233107.34059-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Fix mismatched type in declaration for startup_with_shell X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger X-IsSubscribed: yes When compiling GDB with -flto, I got this error: ../../../gdb/gdbserver/../nat/fork-inferior.h:75:13: error: type of ‘startup_with_shell’ does not match original declaration [-Werror=lto-type-mismatch] extern bool startup_with_shell; ^ ../../../gdb/gdbserver/server.c:74:5: note: type ‘int’ should match type ‘bool’ int startup_with_shell = 1; ^ ../../../gdb/gdbserver/server.c:74:5: note: ‘startup_with_shell’ was previously declared here ../../../gdb/gdbserver/server.c:74:5: note: code may be misoptimized unless -fno-strict-aliasing is used lto1: all warnings being treated as errors lto-wrapper: fatal error: g++ returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status This fixes that. gdb/gdbserver/ChangeLog: 2019-09-30 Christian Biesinger * server.c (startup_with_shell): Change type to bool to match fork-inferior.h and include fork-inferior.h so that this error could be found more easily. --- gdb/gdbserver/server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 67e8e3e54d..1b6e8f5806 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -41,6 +41,7 @@ #include "gdbsupport/environ.h" #include "filenames.h" #include "gdbsupport/pathstuff.h" +#include "nat/fork-inferior.h" #include "gdbsupport/selftest.h" #include "gdbsupport/scope-exit.h" @@ -71,7 +72,7 @@ static gdb_environ our_environ; /* We always try to start the inferior using a shell. */ -int startup_with_shell = 1; +bool startup_with_shell = true; int server_waiting;