From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id pi7DAv8u22DlLQAAWB0awg (envelope-from ) for ; Tue, 29 Jun 2021 10:32:31 -0400 Received: by simark.ca (Postfix, from userid 112) id F0F361F1F2; Tue, 29 Jun 2021 10:32:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 4693C1E01F for ; Tue, 29 Jun 2021 10:32:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E6C7B3888025 for ; Tue, 29 Jun 2021 14:32:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6C7B3888025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624977149; bh=8SKB+N10Z3x/cAJMAg2Fjjo1sWhRF+9Sf/3hyufTSzs=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ZiLYCyXSnIMpN6vB0yVUI6qNv71AxzoXwcg7VxEfR79kQwxExSzsPxO7KqFPdh+3/ kSJOcwyiDYj8uIP8uxLed/zvIBYToC1wgv5VynP1lglka2QhvsAFHDEVWvcv42aiGA 3SU/TuQscC0l7HhknRYqSp+rCLzBeu70THcL2rpg= Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id A5056385DC33 for ; Tue, 29 Jun 2021 14:32:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5056385DC33 Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2C44E335DC1; Tue, 29 Jun 2021 14:32:08 +0000 (UTC) Date: Tue, 29 Jun 2021 10:32:07 -0400 To: "Aktemur, Tankut Baris" Subject: Re: [PATCH 2/3] sim: callback: add printf attributes Message-ID: Mail-Followup-To: "Aktemur, Tankut Baris" , "gdb-patches@sourceware.org" References: <20210628032439.14514-1-vapier@gentoo.org> <20210628032439.14514-2-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: "gdb-patches@sourceware.org" Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 29 Jun 2021 07:01, Aktemur, Tankut Baris wrote: > On Monday, June 28, 2021 5:25 AM, Mike Frysinger wrote: > > This helps these funcs get printf format checking coverage. > > > > The sim-io.c hack as a result is a bit unfortunate, but the compiler > > throws warnings when printing with empty strings. In this one case, > > we actually want that due to the side-effect of the callback halting > > execution for us. > > --- > > include/sim/callback.h | 12 ++++++++---- > > sim/common/sim-io.c | 3 ++- > > 2 files changed, 10 insertions(+), 5 deletions(-) > > This patch resulted in the following build error: > > /path/to/sim/ppc/sim_calls.c: In function ‘sim_io_error’: > /path/to/sim/ppc/sim_calls.c:382:32: error: zero-length gnu_printf format string [-Werror=format-zero-length] > callbacks->error (callbacks, ""); > ^~ > /path/to/sim/ppc/sim_calls.c: In function ‘error’: > /path/to/sim/ppc/sim_calls.c:394:32: error: zero-length gnu_printf format string [-Werror=format-zero-length] > callbacks->error (callbacks, ""); > ^~ are you forcing extra -W flags in your build ? -mike