From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id C285A383D838 for ; Sat, 25 Jun 2022 09:08:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C285A383D838 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F09321FD4E for ; Sat, 25 Jun 2022 09:08:53 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B173C13456 for ; Sat, 25 Jun 2022 09:08:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 23BmA6TQtmJkWwAAMHmgww (envelope-from ) for ; Sat, 25 Jun 2022 09:08:52 +0000 Date: Sat, 25 Jun 2022 11:08:47 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/build] Fix gdb build with -fsanitize=thread and gcc 7 Message-ID: <20220625090840.GA21429@delia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Sat, 25 Jun 2022 09:08:56 -0000 Hi, When building gdb with system gcc 7.5.0, I run into: ... gdb/ia64-tdep.c: In function ‘int is_float_or_hfa_type_recurse(type*, type**)’: gdb/ia64-tdep.c:3362:1: error: control reaches end of non-void function \ [-Werror=return-type] ... This is due to PR gcc/81275 - "-fsanitize=thread produce incorrect -Wreturn-type warning", which has been fixed in gcc-8. Work around this by moving the default return outside the switch. Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/build] Fix gdb build with -fsanitize=thread and gcc 7 --- gdb/ia64-tdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 82456dc9c98..b94225b5e13 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3356,9 +3356,10 @@ is_float_or_hfa_type_recurse (struct type *t, struct type **etp) } break; default: - return 0; break; } + + return 0; } /* Determine if the given type is one of the floating point types or