From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UKlbNxOjzmChdgAAWB0awg (envelope-from ) for ; Sat, 19 Jun 2021 22:08:19 -0400 Received: by simark.ca (Postfix, from userid 112) id E09081F163; Sat, 19 Jun 2021 22:08:19 -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 8A13F1E813 for ; Sat, 19 Jun 2021 22:08:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 999A33848437 for ; Sun, 20 Jun 2021 02:08:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 999A33848437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624154898; bh=oucQgQX7gCxv1y2Zoo2Rz7O3BdOGWlc9psZr9Q8lGVc=; 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=m4W5R0dzIlYen4TKIgnFrT2NQnyeZhcwlD6MwGojL+ECkk9boMuT++SylyxFLn4Gr PX9nBg6SdzqEpNQkbATus6TP79yw1BSZysoaVx7QkHAlU/Pj/kdQDanwnds3r+JL1R zfhSI6xcIE/iDfjWXzfrCfar5ZaKrnnIj+F0SVeo= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 196EF38515EC for ; Sun, 20 Jun 2021 02:07:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 196EF38515EC 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 C4BB934076D; Sun, 20 Jun 2021 02:07:12 +0000 (UTC) Date: Sat, 19 Jun 2021 22:07:12 -0400 To: Simon Marchi Subject: Re: [PATCH 1/2] sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definition Message-ID: Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org References: <20210620013532.578626-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210620013532.578626-1-simon.marchi@polymtl.ca> 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 19 Jun 2021 21:35, Simon Marchi via Gdb-patches wrote: > 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. idea looks fine, but i'm pretty sure we want to s/TYPE UNUSED/UNUSED TYPE/ on this whole file, not this one macro. -mike