public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org, Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [PATCH 1/5] misc: Sync cdefs.h with gnulib
Date: Wed, 13 Jan 2021 15:30:57 -0300	[thread overview]
Message-ID: <1ffd0c02-26d3-020f-087e-deb9a3729c42@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2101131759560.1278751@digraph.polyomino.org.uk>



On 13/01/2021 15:09, Joseph Myers wrote:
> 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++?
> 

It is only used on C code, more specially for lib/malloc/dynarray-skeleton.c.
And I am no sure if gnulib has active support -std=c2x or -std=gnu2x and
I think Paul can give us a better idea on how to support this better on
gnulib side.

  reply	other threads:[~2021-01-13 18:31 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 ` [PATCH 1/5] misc: Sync cdefs.h with gnulib Joseph Myers
2021-01-13 18:30   ` Adhemerval Zanella [this message]
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=1ffd0c02-26d3-020f-087e-deb9a3729c42@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=eggert@cs.ucla.edu \
    --cc=joseph@codesourcery.com \
    --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).