public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH 1/5] misc: Sync cdefs.h with gnulib
Date: Wed, 13 Jan 2021 18:09:10 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2101131759560.1278751@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20210113165826.1014708-1-adhemerval.zanella@linaro.org>

On Wed, 13 Jan 2021, Adhemerval Zanella via Libc-alpha wrote:

> +#if defined __STDC_VERSION__ && 201710L < __STDC_VERSION__
> +# define __attribute_maybe_unused__ [[__maybe_unused__]]

I don't think that will work with GCC 9 -std=c2x or -std=gnu2x (support 
for [[]] attributes was added in GCC 10).  This macro isn't used at all in 
glibc, what compilers and options are expected to be supported for it in 
gnulib?

If you compare __STDC_VERSION__ with the version for the previous 
standard, and intend to support compilers such as GCC 9 -std=gnu2x, you 
need to deal with incomplete implementations using placeholder values 
(202000L in this case).  (You might have incomplete implementations even 
comparing with the final value used for C23, but they're less likely to be 
so incomplete.)

When you're supporting [[__maybe_unused__]] you might want to support it 
for C++17 as well as C2x.  Or is this macro in gnulib only intended to be 
used in C code, not C++?

-- 
Joseph S. Myers
joseph@codesourcery.com

  parent reply	other threads:[~2021-01-13 18:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 16:58 Adhemerval Zanella
2021-01-13 16:58 ` [PATCH 2/5] malloc: Sync dynarray " Adhemerval Zanella
2021-02-09 19:12   ` Adhemerval Zanella
2021-01-13 16:58 ` [PATCH v2 3/5] regex: remove alloca usage on regex set_regs Adhemerval Zanella
2021-02-09 19:12   ` Adhemerval Zanella
2021-01-13 16:58 ` [PATCH v2 4/5] regexec: remove alloca usage in build_trtable Adhemerval Zanella
2021-02-09 19:12   ` Adhemerval Zanella
2021-01-13 16:58 ` [PATCH v2 5/5] regex: stop using alloca Adhemerval Zanella
2021-02-09 19:12   ` Adhemerval Zanella
2021-01-13 18:09 ` Joseph Myers [this message]
2021-01-13 18:30   ` [PATCH 1/5] misc: Sync cdefs.h with gnulib Adhemerval Zanella
2021-02-09 14:07     ` Adhemerval Zanella
2021-01-13 19:19 ` Paul Eggert
2021-01-13 19:21   ` Adhemerval Zanella

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=alpine.DEB.2.22.394.2101131759560.1278751@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /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).