From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 638D03858D39 for ; Thu, 3 Mar 2022 10:36:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 638D03858D39 Received: by mail-wr1-x42e.google.com with SMTP id u10so5466517wra.9 for ; Thu, 03 Mar 2022 02:36:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gjWIv/UbUFIri2WdcRR/uemorov0OIhYhW7S9PEH1TA=; b=1QhOy4afUbq1jSFuZYBOAv+sZvCmUzHbx1OSb3w8FfFOPTec/ER34KkkukO9mIXXwi iRQSz94hM7jwcWSaidkM7yKJUp0FG31Izqhp8+cT/UjmnmSn19su0QIq/gC2aaNolucU bSzxkJAHwmgYFwJ8B9clkSTqet8UBTTQrvtrvNuGfnr42Xa9J6uL6vtlM5nSeSsquW8f /A/rLkyLcK8CR+iDvLR5xDdbhMzLll1gdJC4T03l87FkB5gZfe6VED2Tpbh+G/zlbjcv EQ5vfCROMtahlIb9LiT5RG9dW9U5iJFdrziDb6Zqb4EsW3X8y7lX2QESSUqsVfDGHdnO kzFg== X-Gm-Message-State: AOAM532i3LdyhlKs6I8DQg1TF5DI5AQ2atSQzfkxqUgWlDSgb/DLvWXF u/bGodqZsbRxcwWrHfIUdNppWZ4G/VQaTuBkdqA= X-Google-Smtp-Source: ABdhPJw8dPopmR3QLOCbPLpXs4s6WEeDiCtlHXgy2xRTow6dq9dsCfBzVZgUbvXvYXRHvYnHHlaNBvYorURG+AtsRA0= X-Received: by 2002:a05:6000:154b:b0:1f0:6019:ea3a with SMTP id 11-20020a056000154b00b001f06019ea3amr1057779wry.395.1646303761159; Thu, 03 Mar 2022 02:36:01 -0800 (PST) MIME-Version: 1.0 References: <649f3dd2-54f0-2258-61e5-1304a1140bbe@gmail.com> In-Reply-To: From: Jonathan Wakely Date: Thu, 3 Mar 2022 10:35:49 +0000 Message-ID: Subject: Re: C++ version for GCC development To: Abdullah Siddiqui Cc: Gabriel Ravier , gcc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2022 10:36:04 -0000 On Thu, 3 Mar 2022 at 09:04, Abdullah Siddiqui wrote: > > Hello. > >> Hello. >> >> This question is for the developers of GCC: >> >> Which C++ version are you using to write the C++ code of the current GCC >> version? >> >> >> >> C++11 > > > I know Jonathan said earlier that GCC is implemented in C++11. However, t= his page states the following: > >> As of version 4.8, GCC is (mostly) implemented in C++, C++98 specifical= ly. > > > The current version is GCC 11.2, isn't it? That's the most recent released version. The Git master branch is newer than that. Obviously a page talking about the status as of GCC 4.8 is going to be outdated, because that was about 7 years ago. > At what point did the GCC developers give up C++98 and start using C++11? For GCC 11. This is stated at https://gcc.gnu.org/install/prerequisites.htm= l > Is it correct to say that the C++ code of GCC is composed of both C++98 a= nd C++11? No, IMHO it's not correct. Some files might use an older C++98-ish style, but they are all compiled as C++11 (or newer) and so it would be wrong to say they are C++98. They can use 'auto' type deduction and 'constexpr' and 'noexcept' so they are not C++98. > Additionally, Jonathan also stated the following in one of his emails in = this thread: > >> It also looks like they haven't updated those numbers since April last y= ear, so it will wrongly count all .c files as C even the ones which contain= C++ instead. A huge number of files were renamed from .c to .cc recently, = because they contain C++ and so had a misleading .c extension. That doesn't= seem to be accounted for in those numbers. > > > The page linked above also has a similar claim: > >> As of version 4.8, GCC is (mostly) implemented in C++, but we haven=E2= =80=99t renamed the source files. Hence you will see source files with a .c= extension throughout the source tree. These are generally handled by the b= uild system as C++, rather than C. > > > Does this mean that ALL the files with the ".c" extension in the GCC code= base are C++ files? No, because as I said previously (and you quoted above), they were renamed from .c to .cc recently. Dave's page that talks about "as of version 4.8" is very old now. My email from a few weeks ago is a lot more current. You should use the current information, not the seven year old information. > How shall I determine which files are C++ files and which ones are in C? In the current Git master branch, .c files are C and .cc files are C++. The exceptions are some tests which have .c extensions but get compiled as both C and C++, when we want to test that both language front-ends pass the test.