From patchwork Mon Dec 9 19:44:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 2020231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=M8YN7RQ6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Y6XSN4LdHz1yRC for ; Tue, 10 Dec 2024 06:47:00 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 05FE13858432 for ; Mon, 9 Dec 2024 19:46:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05FE13858432 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=M8YN7RQ6 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 583463858D33 for ; Mon, 9 Dec 2024 19:44:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 583463858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 583463858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733773495; cv=none; b=tf0XxUBM8Z44IcbtrSBaUGr6yYlq+nYUrY1P2tNW42JW65DPQCApef4sIC/4hXrIC1HtSsSa4+ZgnKbbLGVF9KbUbIBS0UmdegmfDNDo/Tw8f0xWmd6RxfFRNpWk19GJGBTLncLucxLJS95IzsHiYvC0Ofs0zPq/NM9dZJgXq5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733773495; c=relaxed/simple; bh=NxEW7aCaNtgI0OO/ELB+bZ82k4I6NnhJvzQyU+fNEeI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gqA1KcQRgye4iqha6oMrMX2YV1QC0Y+Gp3ereg4zuzntlX2/k6i/09QkXuIYAR3wif/bMbOno9TPHqWpi5+sLZ2LYkPQHrfZIFZSORBHpKj7SmFPXnCzCjQwDUIiEUBeX/9tdykKQ7LTmpyHxHgcylXxt5k/wVB65pnbiCratHg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 583463858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733773495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FtaLTUqy0MXcqi7evh/YF3ScAt2YlPO99UL5XUdtCZc=; b=M8YN7RQ6luuMKjD+RVwOBf31gIcLV9RC5VUtkl7sl2nz/KrzPQ5HCthfWFKNK801b7v/Nq XCTFyAGAX+Gv07cWYU2+3FEaMClgzbyRKZQ8XDxaet7aFwJgfPkn5cv4Lfgswcpy2i9HI4 BZTiZ1Lseum4bUeJFJbZbs2i0BOucF4= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-_70HqB4gMq6qZmhOMLBCfg-1; Mon, 09 Dec 2024 14:44:51 -0500 X-MC-Unique: _70HqB4gMq6qZmhOMLBCfg-1 X-Mimecast-MFC-AGG-ID: _70HqB4gMq6qZmhOMLBCfg Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D811F1956088 for ; Mon, 9 Dec 2024 19:44:50 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.81.152]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 54E24300019E; Mon, 9 Dec 2024 19:44:49 +0000 (UTC) From: David Malcolm To: Joseph Myers , gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH] wwwdocs: gcc-15: start adding notes on C23 Date: Mon, 9 Dec 2024 14:44:42 -0500 Message-ID: <20241209194442.3154998-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JrzlYRinN3y15xWNgO3gbvDnMc2UD8nHd9dm7igD4c4_1733773491 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org How does this look? Thanks Dave --- htdocs/gcc-15/changes.html | 12 ++++++++++++ htdocs/gcc-15/porting_to.html | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-15/changes.html b/htdocs/gcc-15/changes.html index 23866bde..94731f55 100644 --- a/htdocs/gcc-15/changes.html +++ b/htdocs/gcc-15/changes.html @@ -96,6 +96,18 @@ a work-in-progress.

musttail statement attribute was added to enforce tail calls. +

C

+
    +
  • GCC 15 changes the default language version for C compilation from + -std=gnu17 + to + -std=gnu23. + If your code relies on older versions of the C standard, you will need to + either add + -std= + to your build flags, or port your code; see the porting notes. +
+

C++

    diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index 702cf507..2c9dce68 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@ -27,7 +27,39 @@ and provide solutions. Let us know if you have suggestions for improvements!

    Note: GCC 15 has not been released yet, so this document is a work-in-progress.

    - +

    C language issues

    + +

    C23 by default

    + + +GCC 15 changes the default language version for C compilation from +-std=gnu17 +to +-std=gnu23. + +If your code relies on older versions of the C standard, you will need to +either add -std= +to your build flags, or port your code. + +C23 brings the following changes: + +

    Function prototypes with empty params change from implicit int to void

    + +

    In C23 () in a function declaration means the same as (void), whereas previously it implicitly declared the function to take an int parameter.

    + +

    Hence + +extern int foo(); + +now means + +extern int foo(void); + +rather than + +extern int foo(int); + +

    Code relying on an implicit int param declaration can be fixed for C23 by adding an explicit int to the function prototype, or you can use -std= to select an earlier version of the C standard.

    C++ language issues