public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Abdullah Siddiqui <siddiquiabdullah92@gmail.com>
Cc: Gabriel Ravier <gabravier@gmail.com>, gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: C++ version for GCC development
Date: Thu, 3 Mar 2022 10:35:49 +0000	[thread overview]
Message-ID: <CAH6eHdRu145LtgNQwMyy5Y1iMhE4Xtopbwsdpzp44GaoSegnXw@mail.gmail.com> (raw)
In-Reply-To: <CADgxu+TrkNF7nkGuYj4W0QDr0B8iXbyTD-h8cH65uk-3NVNKiw@mail.gmail.com>

On Thu, 3 Mar 2022 at 09:04, Abdullah Siddiqui
<siddiquiabdullah92@gmail.com> 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, this page states the following:
>
>>  As of version 4.8, GCC is (mostly) implemented in C++, C++98 specifically.
>
>
> 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.html

> Is it correct to say that the C++ code of GCC is composed of both C++98 and 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 year, 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’t renamed the source files. Hence you will see source files with a .c extension throughout the source tree. These are generally handled by the build system as C++, rather than C.
>
>
> Does this mean that ALL the files with the ".c" extension in the GCC codebase 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.

  reply	other threads:[~2022-03-03 10:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 22:26 Abdullah Siddiqui
2022-02-07 22:56 ` Jonathan Wakely
2022-02-07 23:04   ` Abdullah Siddiqui
2022-02-07 23:35     ` Jonathan Wakely
2022-02-08  0:17       ` Abdullah Siddiqui
2022-02-08  2:21         ` Gabriel Ravier
2022-02-08  2:42           ` Abdullah Siddiqui
2022-02-08  2:44             ` Abdullah Siddiqui
2022-02-08  7:49               ` Jonathan Wakely
2022-02-08 16:56                 ` Abdullah Siddiqui
2022-02-08 16:59                   ` Jonathan Wakely
2022-02-08 17:04                     ` Abdullah Siddiqui
2022-02-08 17:07                       ` Jonathan Wakely
2022-02-09  3:40                         ` Abdullah Siddiqui
2022-03-03  9:04                           ` Abdullah Siddiqui
2022-03-03 10:35                             ` Jonathan Wakely [this message]
2022-03-04  3:07                               ` Abdullah Siddiqui
2022-03-04  6:29                                 ` Xi Ruoyao
2022-03-04 23:01                                   ` Abdullah Siddiqui
2022-03-04  9:13                                 ` Jonathan Wakely
2022-03-04 23:03                                   ` Abdullah Siddiqui

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=CAH6eHdRu145LtgNQwMyy5Y1iMhE4Xtopbwsdpzp44GaoSegnXw@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gabravier@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=siddiquiabdullah92@gmail.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).