public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: <gcc@gcc.gnu.org>
Subject: Re: C2x features status
Date: Sat, 22 Oct 2022 00:13:09 +0200	[thread overview]
Message-ID: <874jvw7rm2.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2210212102170.150427@digraph.polyomino.org.uk> (Joseph Myers's message of "Fri, 21 Oct 2022 21:11:54 +0000")

* Joseph Myers:

> On Fri, 21 Oct 2022, Florian Weimer via Gcc wrote:
>
>> Do you have a list of C2X features that are likely to impact autoconf
>> tests?  Or planned changes in the GCC 13 and 14 default language modes
>> that reject constructs previous accepted as an extension?
>
> I think by far the biggest risk - for builds of old code in general, not 
> necessarily for autoconf tests - comes from the following two changes / 
> groups of changes:
>
> * Change of () in function declarations and definitions to mean (void), as 
> in C++, instead of an unprototyped function.

Hmm, I might need some help to create an instrumented GCC for that.
Maybe keep the processing of declarations as-is, to tell () and (void)
apart, but error out if a function declared without a prototype is
called with one or more arguments?

(The instrumentation works by recording certain errors in ways that an
existing build system will not suppress.  At the end of the build, we
check that no such errors have occurred, otherwise the build is flagged
for manual analysis.  Curiously, it doesn't work that well for the
original project, implicit function declarations—of course there are
some functions we do not implement and whose configure tests are
expected to fail!  But it should give good results for errors which
really can't happen.)

> * New keywords formerly in the user namespace: alignas alignof bool 
> constexpr false nullptr static_assert thread_local true typeof 
> typeof_unqual.  (I haven't yet implemented C2x constexpr, but hope to get 
> to it for GCC 13.  The others are all keywords now in C2x mode on GCC 
> mainline.)  Of these, by far the greatest risk is probably from bool, 
> false and true,

Thanks, I can probably fake this into the GCC-12-based compiler somehow.

> while typeof was enabled by default for -std=gnu* anyway 
> in previous releases so is a lower risk.

Do the semantics of typeof change to align with C++, so that typeof
(int) becomes invalid?

> There are also many new library functions, which obviously pose a risk to 
> programs using those identifiers for their own purposes and also including 
> the relevant header.  I hope the risk from those is lower in general.  
> Many of those aren't yet implemented in glibc; I've been focusing on 
> compiler rather than library features during GCC development stage 1, and 
> also hoping to be able to wait for MPFR 4.2 to be released before 
> implementing many of the new <math.h> functions (to avoid 
> gen-auto-libm-tests depending on an unreleased MPFR version).

Historically, we haven't tracked breakage from changes like the new
iszero macro proactively.  I haven't seen silent autoconf test failures
due to <math.h> changes.  Maybe we can fix issues as they result in
build failures instead.

Thanks,
Florian


  reply	other threads:[~2022-10-21 22:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 17:30 Joseph Myers
2022-10-21 18:31 ` Florian Weimer
2022-10-21 19:14   ` Marek Polacek
2022-10-21 19:29     ` Arsen Arsenović
2022-10-21 19:55       ` Florian Weimer
2022-10-21 20:26         ` Arsen Arsenović
2022-10-21 21:11   ` Joseph Myers
2022-10-21 22:13     ` Florian Weimer [this message]
2022-10-21 22:19       ` Joseph Myers

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=874jvw7rm2.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.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).