Message ID | 568d957b97fadfee53f3450dfd083ca895d1f0bf.1666258361.git.research_trasio@irq.a4lg.com |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 12521383FBA9 for <patchwork@sourceware.org>; Thu, 20 Oct 2022 09:40:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 12521383FBA9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258807; bh=0SR6L9Zdhdk51RUuCUZx3shMzauYnlZxE7y0TXyOjCQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ijSJQXW0ghN+HI2sCaxQYEz9nf/I2EWKcZcYrcIMbQgT5fZGEwOUGP9Zf3GOFNSje 5X/lPfMq54aN9kM7I+5nBWri2v1MU8IbF9T9LmnCK7QFxarB9VXz8pOMOqG+/82jIP 4b7C2z4ei8p3+w96flB3VA79b7qBsepr/3JGomwU= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 391D8398AC3F for <gdb-patches@sourceware.org>; Thu, 20 Oct 2022 09:38:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 391D8398AC3F Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 8BBA2300089; Thu, 20 Oct 2022 09:38:51 +0000 (UTC) To: Tsukasa OI <research_trasio@irq.a4lg.com>, Andrew Burgess <aburgess@redhat.com>, Mike Frysinger <vapier@gentoo.org>, Nick Clifton <nickc@redhat.com> Subject: [PATCH 34/40] sim/rx: Mark unused function Date: Thu, 20 Oct 2022 09:32:39 +0000 Message-Id: <568d957b97fadfee53f3450dfd083ca895d1f0bf.1666258361.git.research_trasio@irq.a4lg.com> In-Reply-To: <cover.1666258361.git.research_trasio@irq.a4lg.com> References: <cover.1666258361.git.research_trasio@irq.a4lg.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tsukasa OI via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tsukasa OI <research_trasio@irq.a4lg.com> Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
sim+gdb: Suppress warnings if built with Clang (big batch 1)
|
|
Commit Message
Tsukasa OI
Oct. 20, 2022, 9:32 a.m. UTC
Clang generates a warning if there is a unused static function ("-Wunused-function"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). Although that this is completely unused, the author considers that this is _happened to be_ unused and choose to keep this function for now. Instead, this commit adds ATTRIBUTE_UNUSED. --- sim/rx/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
lgtm -mike
Tsukasa OI <research_trasio@irq.a4lg.com> writes: > Clang generates a warning if there is a unused static function > ("-Wunused-function"). On the default configuration, it causes a build > failure (unless "--disable-werror" is specified). > > Although that this is completely unused, the author considers that this is > _happened to be_ unused and choose to keep this function for now. What does "happen to be" mean? The function isn't used, right? I'd like to request this patch not be merged. I think the function should just be deleted as unused. If/when there's a need for it, we can just bring it back. Thanks, Andrew > > Instead, this commit adds ATTRIBUTE_UNUSED. > --- > sim/rx/rx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sim/rx/rx.c b/sim/rx/rx.c > index 70b1b9729b7..8646c20d108 100644 > --- a/sim/rx/rx.c > +++ b/sim/rx/rx.c > @@ -754,7 +754,7 @@ typedef union { > float f; > } FloatInt; > > -static inline int > +static inline int ATTRIBUTE_UNUSED > float2int (float f) > { > FloatInt fi; > -- > 2.34.1
On 2022/10/25 1:30, Andrew Burgess wrote: > Tsukasa OI <research_trasio@irq.a4lg.com> writes: > >> Clang generates a warning if there is a unused static function >> ("-Wunused-function"). On the default configuration, it causes a build >> failure (unless "--disable-werror" is specified). >> >> Although that this is completely unused, the author considers that this is >> _happened to be_ unused and choose to keep this function for now. > > What does "happen to be" mean? The function isn't used, right? Why did I say that? Perhaps I usually prefer symmetry. But since we can easily restore it, I agree to just remove the function. Thanks, Tsukasa > > I'd like to request this patch not be merged. I think the function > should just be deleted as unused. If/when there's a need for it, we can > just bring it back. > > Thanks, > Andrew > > > > >> >> Instead, this commit adds ATTRIBUTE_UNUSED. >> --- >> sim/rx/rx.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/sim/rx/rx.c b/sim/rx/rx.c >> index 70b1b9729b7..8646c20d108 100644 >> --- a/sim/rx/rx.c >> +++ b/sim/rx/rx.c >> @@ -754,7 +754,7 @@ typedef union { >> float f; >> } FloatInt; >> >> -static inline int >> +static inline int ATTRIBUTE_UNUSED >> float2int (float f) >> { >> FloatInt fi; >> -- >> 2.34.1 >
diff --git a/sim/rx/rx.c b/sim/rx/rx.c index 70b1b9729b7..8646c20d108 100644 --- a/sim/rx/rx.c +++ b/sim/rx/rx.c @@ -754,7 +754,7 @@ typedef union { float f; } FloatInt; -static inline int +static inline int ATTRIBUTE_UNUSED float2int (float f) { FloatInt fi;