C++ version for GCC development
Jonathan Wakely
jwakely.gcc@gmail.com
Thu Mar 3 10:35:49 GMT 2022
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.
More information about the Gcc-help
mailing list