From: Jakub Jelinek <jakub@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: Markus Faehling <markus@faehling.com>, gcc@gcc.gnu.org
Subject: Re: GCC/clang warning incompatibility with unused private member variables
Date: Fri, 11 Jun 2021 22:35:57 +0200 [thread overview]
Message-ID: <20210611203557.GX7746@tucnak> (raw)
In-Reply-To: <7aa76520-3250-1bda-9fd9-baee1e83cd44@redhat.com>
On Fri, Jun 11, 2021 at 04:03:34PM -0400, Jason Merrill via Gcc wrote:
> You can use #pragma to disable a warning for a particular section of code:
>
> #pragma GCC diagnostic push
> #pragma GCC diagnostic ignored "-Wattributes"
> class Test {
> [[maybe_unused]] int a_;
> void b() {};
> };
> #pragma GCC diagnostic pop
>
> But I also agree that GCC shouldn't warn here.
We could do that by using a wrapper around handle_unused_attribute
for the maybe_unused attribute, that way warn on unused attribute on
FIELD_DECLs, but not for maybe_unused (until we actually implement some
warning that uses it).
Jakub
next prev parent reply other threads:[~2021-06-11 20:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 19:37 Markus Faehling
2021-06-11 19:59 ` Gabriel Ravier
2021-06-11 20:03 ` Jason Merrill
2021-06-11 20:35 ` Jakub Jelinek [this message]
2021-06-13 17:19 ` Jason Merrill
2021-06-11 22:14 ` Jonathan Wakely
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=20210611203557.GX7746@tucnak \
--to=jakub@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=markus@faehling.com \
/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).