From: Mike Frysinger <vapier@gentoo.org>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definition
Date: Sat, 19 Jun 2021 22:07:12 -0400 [thread overview]
Message-ID: <YM6i0IXMRMpwyASs@vapier> (raw)
In-Reply-To: <20210620013532.578626-1-simon.marchi@polymtl.ca>
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
next prev parent reply other threads:[~2021-06-20 2:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-20 1:35 Simon Marchi
2021-06-20 1:35 ` [PATCH 2/2] sim: use INLINE2 in STATIC_INLINE's definition Simon Marchi
2021-06-20 2:07 ` Mike Frysinger [this message]
2021-06-20 2:21 ` [PATCH 1/2] sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definition Simon Marchi
2021-06-20 2:47 ` Mike Frysinger
2021-06-20 2:50 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YM6i0IXMRMpwyASs@vapier \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).