From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) From: Tsukasa OI To: Tsukasa OI , Andrew Burgess , Mike Frysinger Cc: gdb-patches@sourceware.org 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-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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: Tue, 13 Sep 2022 12:57:48 -0000 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