From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UFi/M19+IGOTAjkAWB0awg (envelope-from ) for ; Tue, 13 Sep 2022 08:58:07 -0400 Received: by simark.ca (Postfix, from userid 112) id D08CE1E112; Tue, 13 Sep 2022 08:58:07 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=vjPrx4EU; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D8DEB1E0D5 for ; Tue, 13 Sep 2022 08:58:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 754873857000 for ; Tue, 13 Sep 2022 12:58:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 754873857000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663073886; bh=dXwg87/+2zac3WWwug1Z3S1xTLiWa0iT+exw9jmX0fk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=vjPrx4EUY4AufRhmCq0sW6qMVq8AwZ3b3Iu9MD4kA3rndCrfibbVFDgY9yHz2FsZH tW10aRrbws9hUv8JjIrf/DH+ZlBJDKs5/+6sey+1mCOcD37t7o50G+izzZuJOz3MEU tB1H7l775uk6AIbZmixK3tC5TZXFepxR0Lf4+btE= Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 9B0513858D39 for ; Tue, 13 Sep 2022 12:57:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B0513858D39 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 477AA300089; Tue, 13 Sep 2022 12:57:43 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger Subject: [PATCH 0/4] sim/common: Suppress warnings if built with Clang Date: Tue, 13 Sep 2022 12:57:28 +0000 Message-Id: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hello, [Common Background: Building GNU Binutils / GDB with Clang 15.0.0] I'm now testing to build GNU Binutils / GDB with latest Clang (15.0.0) and found some errors by default (when Binutils / GDB is not configured with "--disable-werror"). While the best compiler to build GNU Binutils / GDB is GNU GCC, testing other compilers are helpful to discover underlying problems and modernize Binutils / GDB, even if building entire Binutils / GDB with the latest Clang is unrealistic. To be sure, I'm not going to finish "porting for Clang". I will take low-hanging fruits and... 1. make building with Clang easier and/or 2. fix code issues (or non-issues) discovered as Clang warnings. I made four patchsets in which, applying them all makes it possible to build GNU Binutils / GDB with Clang (without help of --disable-werrors) for many (but not all) targets including i386 and RISC-V with Ubuntu 22.04 LTS (x86_64) host. At least, I think they fix all (at minimum, most of) arch- independent parts which prevents building with the latest version of Clang. This is the one of them. [About this Patchset] This patchset contains four minor fixes to the files under sim/common/. Each contains minor fixes to suppress Clang warnings. Especially, adding ATTRIBUTE_PRINTF (PATCH 1/4) is important for better static analysis, even from GNU toolchain side. For the rest, see commit descriptions for each patch. Thanks, Tsukasa Tsukasa OI (4): sim: Add ATTRIBUTE_PRINTF sim: Remove self-assignments sim: Make WITH_{TRACE,PROFILE}-based macros bool sim: Suppress non-literal printf warning sim/common/hw-tree.c | 2 -- sim/common/sim-cpu.h | 3 ++- sim/common/sim-hw.c | 3 +++ sim/common/sim-profile.h | 12 ++++++------ sim/common/sim-trace.h | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) base-commit: 8fa9bc6a030c9a41eb8cf6f0f66043e02005b291 -- 2.34.1