From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sCNYH6KbzmACdgAAWB0awg (envelope-from ) for ; Sat, 19 Jun 2021 21:36:34 -0400 Received: by simark.ca (Postfix, from userid 112) id 7E0011F163; Sat, 19 Jun 2021 21:36:34 -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=unavailable 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 31A401E813 for ; Sat, 19 Jun 2021 21:36:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7CC438515EC for ; Sun, 20 Jun 2021 01:36:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7CC438515EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624152993; bh=7Yrfu9IXCFR31GnTzThuHMXkIAJ4wT1vjd/DJFd5AZc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wrygV0LTReEfoJczAsthkDnT4ctxU0SphvOI3qeSCljqI3xhzQgmsfKUXT3BCzwbt 4dbqYHbn5HQFyGfzUBz2gEWyCnJ9czFQuX+xTJg05KlpHdzvE6EdZGfAK3+GpD6byN nsO6byuqFhIZnYBK7TveRSGCOCbFObiBAabPXYbQ= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 3DF96385802D for ; Sun, 20 Jun 2021 01:35:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3DF96385802D X-ASG-Debug-ID: 1624152932-0c856e6cd518efa50001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id 5LN96kGzND7BFI2c (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Jun 2021 21:35:33 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id D22B4441B21; Sat, 19 Jun 2021 21:35:32 -0400 (EDT) X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 1/2] sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definition Date: Sat, 19 Jun 2021 21:35:31 -0400 X-ASG-Orig-Subj: [PATCH 1/2] sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definition Message-Id: <20210620013532.578626-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1624152933 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2349 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.90767 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" I get this when building with gcc 11: CC common/common_libcommon_a-sim-load.o In file included from /home/simark/src/binutils-gdb/sim/common/sim-n-bits.h:27, from /home/simark/src/binutils-gdb/sim/common/sim-bits.c:259, from /home/simark/src/binutils-gdb/sim/common/sim-bits.h:599, from /home/simark/src/binutils-gdb/sim/common/sim-basics.h:122, from /home/simark/src/binutils-gdb/sim/common/sim-load.c:30: /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:27: error: ‘offset_16’ defined but not used [-Werror=unused-function] 39 | #define offset_N XCONCAT2(offset_,N) | ^~~~~~~ /home/simark/src/binutils-gdb/sim/../include/symcat.h:23:26: note: in definition of macro ‘CONCAT2’ 23 | #define CONCAT2(a,b) a##b | ^ /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:18: note: in expansion of macro ‘XCONCAT2’ 39 | #define offset_N XCONCAT2(offset_,N) | ^~~~~~~~ /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:138:1: note: in expansion of macro ‘offset_N’ 138 | offset_N (unsigned_N *x, | ^~~~~~~~ offset_N uses INLINE_SIM_ENDIAN, which uses UNUSED to put the "unused" attribute. However, it appears after the function's return type, which seems to make it not apply to the function. Moving it to before the return type fixes the error. sim/common/ChangeLog: * sim-inline.h (SIM_ENDIAN_INLINE): Move UNUSED before TYPE. Change-Id: Ide20106683ed7a9ebf35d484dabf70b309cb1ba6 --- sim/common/sim-inline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/common/sim-inline.h b/sim/common/sim-inline.h index 2750fa93cbc7..6ac4942e3521 100644 --- a/sim/common/sim-inline.h +++ b/sim/common/sim-inline.h @@ -445,7 +445,7 @@ && !defined (SIM_ENDIAN_C) \ && (REVEAL_MODULE_P (SIM_ENDIAN_INLINE))) # if (SIM_ENDIAN_INLINE & INLINE_GLOBALS) -# define INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE UNUSED +# define INLINE_SIM_ENDIAN(TYPE) static INLINE UNUSED TYPE # define EXTERN_SIM_ENDIAN_P 0 # else # define INLINE_SIM_ENDIAN(TYPE) static TYPE UNUSED -- 2.32.0