From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id AF30E3851C36 for ; Fri, 12 Jun 2020 16:37:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AF30E3851C36 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4B2A5AEAC for ; Fri, 12 Jun 2020 16:37:22 +0000 (UTC) Date: Fri, 12 Jun 2020 18:37:16 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdbserver] Fix Wlto-type-mismatch for debug_agent Message-ID: <20200612163715.GA21612@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-15.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 16:37:21 -0000 Hi, When building gdb including gdbserver with CFLAGS/CXXFLAGS -O2 -g -flto=auto, I run into: ... src/gdbserver/../gdbsupport/agent.h:47:13: error: type of 'debug_agent' \ does not match original declaration [-Werror=lto-type-mismatch] extern bool debug_agent; ^ src/gdbserver/ax.cc:28:5: note: type 'int' should match type 'bool' int debug_agent = 0; ^ src/gdbserver/ax.cc:28:5: note: 'debug_agent' was previously declared here src/gdbserver/ax.cc:28:5: note: code may be misoptimized unless \ -fno-strict-aliasing is used ... Fix this by changing the type of debug_agent in ax.cc from int to bool. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdbserver] Fix Wlto-type-mismatch for debug_agent --- gdbserver/ax.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbserver/ax.cc b/gdbserver/ax.cc index 213db410a0..42d28128fa 100644 --- a/gdbserver/ax.cc +++ b/gdbserver/ax.cc @@ -25,7 +25,7 @@ static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2); #ifdef IN_PROCESS_AGENT -int debug_agent = 0; +bool debug_agent = 0; #endif static void