* C++ version for GCC development @ 2022-02-07 22:26 Abdullah Siddiqui 2022-02-07 22:56 ` Jonathan Wakely 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-07 22:26 UTC (permalink / raw) To: gcc-help 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? Is only 14% of the current GCC codebase composed of C++ code? Waiting for your reply. Regards, Abdullah. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-07 22:26 C++ version for GCC development Abdullah Siddiqui @ 2022-02-07 22:56 ` Jonathan Wakely 2022-02-07 23:04 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Jonathan Wakely @ 2022-02-07 22:56 UTC (permalink / raw) To: Abdullah Siddiqui; +Cc: gcc-help On Mon, 7 Feb 2022, 22:27 Abdullah Siddiqui via Gcc-help, < gcc-help@gcc.gnu.org> wrote: > 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 Is only 14% of the current GCC codebase composed of C++ code? > Where do you get that number? It seems low. > > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-07 22:56 ` Jonathan Wakely @ 2022-02-07 23:04 ` Abdullah Siddiqui 2022-02-07 23:35 ` Jonathan Wakely 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-07 23:04 UTC (permalink / raw) To: Jonathan Wakely; +Cc: gcc-help Hello Jonathan. Thank you for the quick response. I got 14% from the following GitHub page: https://github.com/gcc-mirror/gcc Am I not looking at the correct source for the GCC source code? Waiting for your reply. Regards, Abdullah. On Mon, Feb 7, 2022, 5:56 PM Jonathan Wakely, <jwakely.gcc@gmail.com> wrote: > > > On Mon, 7 Feb 2022, 22:27 Abdullah Siddiqui via Gcc-help, < > gcc-help@gcc.gnu.org> wrote: > >> 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 > > > Is only 14% of the current GCC codebase composed of C++ code? >> > > > Where do you get that number? It seems low. > > >> >> ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-07 23:04 ` Abdullah Siddiqui @ 2022-02-07 23:35 ` Jonathan Wakely 2022-02-08 0:17 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Jonathan Wakely @ 2022-02-07 23:35 UTC (permalink / raw) To: Abdullah Siddiqui; +Cc: gcc-help On Mon, 7 Feb 2022 at 23:04, Abdullah Siddiqui <siddiquiabdullah92@gmail.com> wrote: > Hello Jonathan. > > Thank you for the quick response. > > I got 14% from the following GitHub page: > > https://github.com/gcc-mirror/gcc > > Am I not looking at the correct source for the GCC source code? > That's an unofficial mirror that's nothing to do with the GCC project, but it does have a copy of the right sources. Those numbers are wrong though. It counts several .h and .C files as C when they are C++. It's a rough estimate based on simple heuristics done automatically by GitHub. The true number is higher. 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. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-07 23:35 ` Jonathan Wakely @ 2022-02-08 0:17 ` Abdullah Siddiqui 2022-02-08 2:21 ` Gabriel Ravier 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-08 0:17 UTC (permalink / raw) To: Jonathan Wakely; +Cc: gcc-help Jonathan, Thank you for the clarification. Can I still refer to the code in the GitHub repo for the latest source code of GCC or is it obsolete? Waiting for your reply. Regards, Abdullah. On Mon, Feb 7, 2022, 6:35 PM Jonathan Wakely, <jwakely.gcc@gmail.com> wrote: > > > On Mon, 7 Feb 2022 at 23:04, Abdullah Siddiqui < > siddiquiabdullah92@gmail.com> wrote: > >> Hello Jonathan. >> >> Thank you for the quick response. >> >> I got 14% from the following GitHub page: >> >> https://github.com/gcc-mirror/gcc >> >> Am I not looking at the correct source for the GCC source code? >> > > That's an unofficial mirror that's nothing to do with the GCC project, but > it does have a copy of the right sources. Those numbers are wrong though. > It counts several .h and .C files as C when they are C++. It's a rough > estimate based on simple heuristics done automatically by GitHub. The true > number is higher. > > 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. > > > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 0:17 ` Abdullah Siddiqui @ 2022-02-08 2:21 ` Gabriel Ravier 2022-02-08 2:42 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Gabriel Ravier @ 2022-02-08 2:21 UTC (permalink / raw) To: Abdullah Siddiqui, Jonathan Wakely; +Cc: gcc-help On 2/8/22 01:17, Abdullah Siddiqui via Gcc-help wrote: > Jonathan, > > Thank you for the clarification. > > Can I still refer to the code in the GitHub repo for the latest source code > of GCC or is it obsolete? Although the repository is unofficial, it does appear to be up to date with GCC's git repository (although perhaps with a few minutes/hours of delay, but that shouldn't be a problem for most purposes). > Waiting for your reply. > > Regards, > Abdullah. > > On Mon, Feb 7, 2022, 6:35 PM Jonathan Wakely, <jwakely.gcc@gmail.com> wrote: > >> >> On Mon, 7 Feb 2022 at 23:04, Abdullah Siddiqui < >> siddiquiabdullah92@gmail.com> wrote: >> >>> Hello Jonathan. >>> >>> Thank you for the quick response. >>> >>> I got 14% from the following GitHub page: >>> >>> https://github.com/gcc-mirror/gcc >>> >>> Am I not looking at the correct source for the GCC source code? >>> >> That's an unofficial mirror that's nothing to do with the GCC project, but >> it does have a copy of the right sources. Those numbers are wrong though. >> It counts several .h and .C files as C when they are C++. It's a rough >> estimate based on simple heuristics done automatically by GitHub. The true >> number is higher. >> >> 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. >> >> >> ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 2:21 ` Gabriel Ravier @ 2022-02-08 2:42 ` Abdullah Siddiqui 2022-02-08 2:44 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-08 2:42 UTC (permalink / raw) To: Gabriel Ravier; +Cc: Jonathan Wakely, gcc-help Hello Gabriel. Thank you for the confirmation. Regards, Abdullah. On Mon, Feb 7, 2022, 9:21 PM Gabriel Ravier, <gabravier@gmail.com> wrote: > On 2/8/22 01:17, Abdullah Siddiqui via Gcc-help wrote: > > Jonathan, > > > > Thank you for the clarification. > > > > Can I still refer to the code in the GitHub repo for the latest source > code > > of GCC or is it obsolete? > > Although the repository is unofficial, it does appear to be up to date > with GCC's git repository (although perhaps with a few minutes/hours of > delay, but that shouldn't be a problem for most purposes). > > > Waiting for your reply. > > > > Regards, > > Abdullah. > > > > On Mon, Feb 7, 2022, 6:35 PM Jonathan Wakely, <jwakely.gcc@gmail.com> > wrote: > > > >> > >> On Mon, 7 Feb 2022 at 23:04, Abdullah Siddiqui < > >> siddiquiabdullah92@gmail.com> wrote: > >> > >>> Hello Jonathan. > >>> > >>> Thank you for the quick response. > >>> > >>> I got 14% from the following GitHub page: > >>> > >>> https://github.com/gcc-mirror/gcc > >>> > >>> Am I not looking at the correct source for the GCC source code? > >>> > >> That's an unofficial mirror that's nothing to do with the GCC project, > but > >> it does have a copy of the right sources. Those numbers are wrong > though. > >> It counts several .h and .C files as C when they are C++. It's a rough > >> estimate based on simple heuristics done automatically by GitHub. The > true > >> number is higher. > >> > >> 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. > >> > >> > >> > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 2:42 ` Abdullah Siddiqui @ 2022-02-08 2:44 ` Abdullah Siddiqui 2022-02-08 7:49 ` Jonathan Wakely 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-08 2:44 UTC (permalink / raw) To: Gabriel Ravier; +Cc: Jonathan Wakely, gcc-help Are there no plans to use C++14 and up for further GCC development? Waiting for your reply. Regards, Abdullah. On Mon, Feb 7, 2022, 9:42 PM Abdullah Siddiqui, < siddiquiabdullah92@gmail.com> wrote: > Hello Gabriel. > > Thank you for the confirmation. > > Regards, > Abdullah. > > On Mon, Feb 7, 2022, 9:21 PM Gabriel Ravier, <gabravier@gmail.com> wrote: > >> On 2/8/22 01:17, Abdullah Siddiqui via Gcc-help wrote: >> > Jonathan, >> > >> > Thank you for the clarification. >> > >> > Can I still refer to the code in the GitHub repo for the latest source >> code >> > of GCC or is it obsolete? >> >> Although the repository is unofficial, it does appear to be up to date >> with GCC's git repository (although perhaps with a few minutes/hours of >> delay, but that shouldn't be a problem for most purposes). >> >> > Waiting for your reply. >> > >> > Regards, >> > Abdullah. >> > >> > On Mon, Feb 7, 2022, 6:35 PM Jonathan Wakely, <jwakely.gcc@gmail.com> >> wrote: >> > >> >> >> >> On Mon, 7 Feb 2022 at 23:04, Abdullah Siddiqui < >> >> siddiquiabdullah92@gmail.com> wrote: >> >> >> >>> Hello Jonathan. >> >>> >> >>> Thank you for the quick response. >> >>> >> >>> I got 14% from the following GitHub page: >> >>> >> >>> https://github.com/gcc-mirror/gcc >> >>> >> >>> Am I not looking at the correct source for the GCC source code? >> >>> >> >> That's an unofficial mirror that's nothing to do with the GCC project, >> but >> >> it does have a copy of the right sources. Those numbers are wrong >> though. >> >> It counts several .h and .C files as C when they are C++. It's a rough >> >> estimate based on simple heuristics done automatically by GitHub. The >> true >> >> number is higher. >> >> >> >> 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. >> >> >> >> >> >> >> > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 2:44 ` Abdullah Siddiqui @ 2022-02-08 7:49 ` Jonathan Wakely 2022-02-08 16:56 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Jonathan Wakely @ 2022-02-08 7:49 UTC (permalink / raw) To: Abdullah Siddiqui; +Cc: Gabriel Ravier, gcc-help On Tue, 8 Feb 2022, 02:44 Abdullah Siddiqui, <siddiquiabdullah92@gmail.com> wrote: > Are there no plans to use C++14 and up for further GCC development? > No. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 7:49 ` Jonathan Wakely @ 2022-02-08 16:56 ` Abdullah Siddiqui 2022-02-08 16:59 ` Jonathan Wakely 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-08 16:56 UTC (permalink / raw) To: Jonathan Wakely; +Cc: Gabriel Ravier, gcc-help Ok. Thank you for the prompt responses. May I know which source I SHOULD refer to for getting the latest GCC source code? Regards, Abdullah. On Tue, Feb 8, 2022, 2:49 AM Jonathan Wakely, <jwakely.gcc@gmail.com> wrote: > > > On Tue, 8 Feb 2022, 02:44 Abdullah Siddiqui, <siddiquiabdullah92@gmail.com> > wrote: > >> Are there no plans to use C++14 and up for further GCC development? >> > > > No. > > > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 16:56 ` Abdullah Siddiqui @ 2022-02-08 16:59 ` Jonathan Wakely 2022-02-08 17:04 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Jonathan Wakely @ 2022-02-08 16:59 UTC (permalink / raw) To: Abdullah Siddiqui; +Cc: Gabriel Ravier, gcc-help On Tue, 8 Feb 2022 at 16:57, Abdullah Siddiqui <siddiquiabdullah92@gmail.com> wrote: > Ok. Thank you for the prompt responses. > > May I know which source I SHOULD refer to for getting the latest GCC > source code? > Did you try looking at https://gcc.gnu.org ? There's a "Git" entry in the sidebar, which links to https://gcc.gnu.org/git.html The GitHub mirror also links to the official repo (under th repo name at the top left). ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 16:59 ` Jonathan Wakely @ 2022-02-08 17:04 ` Abdullah Siddiqui 2022-02-08 17:07 ` Jonathan Wakely 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-08 17:04 UTC (permalink / raw) To: Jonathan Wakely; +Cc: Gabriel Ravier, gcc-help Jonathan, Oh ok. I already checked out GCC from your second link https://gcc.gnu.org/git.html. I just wanted to know if I could access the code from the browser itself (like on GitHub). Thank you. Regards, Abdullah. On Tue, Feb 8, 2022, 11:59 AM Jonathan Wakely, <jwakely.gcc@gmail.com> wrote: > > > On Tue, 8 Feb 2022 at 16:57, Abdullah Siddiqui < > siddiquiabdullah92@gmail.com> wrote: > >> Ok. Thank you for the prompt responses. >> >> May I know which source I SHOULD refer to for getting the latest GCC >> source code? >> > > Did you try looking at https://gcc.gnu.org ? There's a "Git" entry in the > sidebar, which links to https://gcc.gnu.org/git.html > > The GitHub mirror also links to the official repo (under th repo name at > the top left). > > > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 17:04 ` Abdullah Siddiqui @ 2022-02-08 17:07 ` Jonathan Wakely 2022-02-09 3:40 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Jonathan Wakely @ 2022-02-08 17:07 UTC (permalink / raw) To: Abdullah Siddiqui; +Cc: Gabriel Ravier, gcc-help On Tue, 8 Feb 2022 at 17:04, Abdullah Siddiqui <siddiquiabdullah92@gmail.com> wrote: > Jonathan, > > Oh ok. I already checked out GCC from your second link > https://gcc.gnu.org/git.html. I just wanted to know if I could access the > code from the browser itself (like on GitHub). > Like it says at that link, you can browse it at https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-08 17:07 ` Jonathan Wakely @ 2022-02-09 3:40 ` Abdullah Siddiqui 2022-03-03 9:04 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-02-09 3:40 UTC (permalink / raw) To: Jonathan Wakely; +Cc: Gabriel Ravier, gcc-help Thank you. On Tue, Feb 8, 2022, 12:07 PM Jonathan Wakely, <jwakely.gcc@gmail.com> wrote: > > > On Tue, 8 Feb 2022 at 17:04, Abdullah Siddiqui < > siddiquiabdullah92@gmail.com> wrote: > >> Jonathan, >> >> Oh ok. I already checked out GCC from your second link >> https://gcc.gnu.org/git.html. I just wanted to know if I could access >> the code from the browser itself (like on GitHub). >> > > Like it says at that link, you can browse it at > https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git > > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-02-09 3:40 ` Abdullah Siddiqui @ 2022-03-03 9:04 ` Abdullah Siddiqui 2022-03-03 10:35 ` Jonathan Wakely 0 siblings, 1 reply; 21+ messages in thread From: Abdullah Siddiqui @ 2022-03-03 9:04 UTC (permalink / raw) To: Jonathan Wakely; +Cc: Gabriel Ravier, gcc-help 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 <https://dmalcolm.fedorapeople.org/gcc/newbies-guide/gotchas-and-faq.html> 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? At what point did the GCC developers give up C++98 and start using C++11? Is it correct to say that the C++ code of GCC is composed of both C++98 and C++11? 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? How shall I determine which files are C++ files and which ones are in C? Regards, Abdullah. On Tue, Feb 8, 2022 at 10:40 PM Abdullah Siddiqui < siddiquiabdullah92@gmail.com> wrote: > Thank you. > > On Tue, Feb 8, 2022, 12:07 PM Jonathan Wakely, <jwakely.gcc@gmail.com> > wrote: > >> >> >> On Tue, 8 Feb 2022 at 17:04, Abdullah Siddiqui < >> siddiquiabdullah92@gmail.com> wrote: >> >>> Jonathan, >>> >>> Oh ok. I already checked out GCC from your second link >>> https://gcc.gnu.org/git.html. I just wanted to know if I could access >>> the code from the browser itself (like on GitHub). >>> >> >> Like it says at that link, you can browse it at >> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git >> >> ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-03-03 9:04 ` Abdullah Siddiqui @ 2022-03-03 10:35 ` Jonathan Wakely 2022-03-04 3:07 ` Abdullah Siddiqui 0 siblings, 1 reply; 21+ messages in thread From: Jonathan Wakely @ 2022-03-03 10:35 UTC (permalink / raw) To: Abdullah Siddiqui; +Cc: Gabriel Ravier, gcc-help 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. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-03-03 10:35 ` Jonathan Wakely @ 2022-03-04 3:07 ` Abdullah Siddiqui 2022-03-04 6:29 ` Xi Ruoyao 2022-03-04 9:13 ` Jonathan Wakely 0 siblings, 2 replies; 21+ messages in thread From: Abdullah Siddiqui @ 2022-03-04 3:07 UTC (permalink / raw) To: Jonathan Wakely; +Cc: Gabriel Ravier, gcc-help Hello Jonathan. Thank you for the detailed clarification. > 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 Are you referring to these lines: ISO C++11 compiler > Necessary to bootstrap GCC. Versions of GCC prior to 11 also allow bootstrapping with an ISO C++98 > compiler,..... I thought bootstrapping and compilation are two separate things. In this context, are bootstrapping and compilation the same i.e. GCC is a compiler and the ISO C++11 compiler is being used to compile GCC? 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. Are you referring to files in the testsuite folders (example: gcc/testsuite/g++.dg/lto/pr65302_1.C)? Regards, Abdullah. On Thu, Mar 3, 2022 at 5:36 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > 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. > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 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 1 sibling, 1 reply; 21+ messages in thread From: Xi Ruoyao @ 2022-03-04 6:29 UTC (permalink / raw) To: Abdullah Siddiqui, Jonathan Wakely; +Cc: gcc-help On Thu, 2022-03-03 at 22:07 -0500, Abdullah Siddiqui via Gcc-help wrote: > Hello Jonathan. > > Thank you for the detailed clarification. > > > 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 > > > Are you referring to these lines: > > ISO C++11 compiler > > Necessary to bootstrap GCC. > > Versions of GCC prior to 11 also allow bootstrapping with an ISO C++98 > > compiler,..... > > > I thought bootstrapping and compilation are two separate things. In this > context, are bootstrapping and compilation the same i.e. GCC is a compiler > and the ISO C++11 compiler is being used to compile GCC? In theory, compiling GCC with --disable-bootstrap may have a *more* strict restriction on host compiler than bootstrapping (--enable- bootstrap is the default building a native compiler). It's because with --disable-bootstrap the entire GCC will be built with the host compiler, but with --enable-bootstrap only stage 1 is built with the host compiler, and stage 2 is built with stage 1. In stage 1 some optional features (Go or D compilers, etc) are not enabled. But in practice I don't know. Maybe it's possible to build GCC 11 with GCC 4.8 and --disable-bootstrap but I've not tried. I don't think it's really rational to spend an hour testing this in 2022. > 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. > > > Are you referring to files in the testsuite folders > (example: gcc/testsuite/g++.dg/lto/pr65302_1.C)? Files in g++.dg are purely C++. Please note ".C" (with a capital letter) is not same as ".c". For example, gcc/testsuite/c-c++-common/pr100785.c is compiled as both C and C++ during the testing process of GCC. > -- Xi Ruoyao <xry111@mengyan1223.wang> School of Aerospace Science and Technology, Xidian University ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-03-04 6:29 ` Xi Ruoyao @ 2022-03-04 23:01 ` Abdullah Siddiqui 0 siblings, 0 replies; 21+ messages in thread From: Abdullah Siddiqui @ 2022-03-04 23:01 UTC (permalink / raw) To: Xi Ruoyao; +Cc: Jonathan Wakely, gcc-help Hello Xi. Thank you for the clear explanation. Regards, Abdullah. On Fri, Mar 4, 2022, 1:29 AM Xi Ruoyao, <xry111@mengyan1223.wang> wrote: > On Thu, 2022-03-03 at 22:07 -0500, Abdullah Siddiqui via Gcc-help wrote: > > Hello Jonathan. > > > > Thank you for the detailed clarification. > > > > > 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 > > > > > > Are you referring to these lines: > > > > ISO C++11 compiler > > > Necessary to bootstrap GCC. > > > > Versions of GCC prior to 11 also allow bootstrapping with an ISO C++98 > > > compiler,..... > > > > > > I thought bootstrapping and compilation are two separate things. In this > > context, are bootstrapping and compilation the same i.e. GCC is a > compiler > > and the ISO C++11 compiler is being used to compile GCC? > > In theory, compiling GCC with --disable-bootstrap may have a *more* > strict restriction on host compiler than bootstrapping (--enable- > bootstrap is the default building a native compiler). It's because with > --disable-bootstrap the entire GCC will be built with the host compiler, > but with --enable-bootstrap only stage 1 is built with the host > compiler, and stage 2 is built with stage 1. In stage 1 some optional > features (Go or D compilers, etc) are not enabled. > > But in practice I don't know. Maybe it's possible to build GCC 11 with > GCC 4.8 and --disable-bootstrap but I've not tried. I don't think it's > really rational to spend an hour testing this in 2022. > > > 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. > > > > > > Are you referring to files in the testsuite folders > > (example: gcc/testsuite/g++.dg/lto/pr65302_1.C)? > > Files in g++.dg are purely C++. Please note ".C" (with a capital > letter) is not same as ".c". > > For example, gcc/testsuite/c-c++-common/pr100785.c is compiled as both C > and C++ during the testing process of GCC. > > > -- > Xi Ruoyao <xry111@mengyan1223.wang> > School of Aerospace Science and Technology, Xidian University > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-03-04 3:07 ` Abdullah Siddiqui 2022-03-04 6:29 ` Xi Ruoyao @ 2022-03-04 9:13 ` Jonathan Wakely 2022-03-04 23:03 ` Abdullah Siddiqui 1 sibling, 1 reply; 21+ messages in thread From: Jonathan Wakely @ 2022-03-04 9:13 UTC (permalink / raw) To: Abdullah Siddiqui; +Cc: Gabriel Ravier, gcc-help On Fri, 4 Mar 2022 at 03:07, Abdullah Siddiqui <siddiquiabdullah92@gmail.com> wrote: > > Hello Jonathan. > > Thank you for the detailed clarification. > >> > 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 > > > Are you referring to these lines: > >> ISO C++11 compiler >> Necessary to bootstrap GCC. >> >> Versions of GCC prior to 11 also allow bootstrapping with an ISO C++98 compiler,..... Yes, those lines. > > I thought bootstrapping and compilation are two separate things. In this context, are bootstrapping and compilation the same i.e. GCC is a compiler and the ISO C++11 compiler is being used to compile GCC? Yes, that's right. In this context bootstrapping GCC means building it from source (which includes compilation but also linking, and then repeating the whole process using the just-built GCC to build itself again). Since GCC 11, the first stage where you build GCC with a pre-existing compiler must be done with a C++11 compiler. Before GCC 11 a C++98 compiler was needed. > >> 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. > > > Are you referring to files in the testsuite folders (example: gcc/testsuite/g++.dg/lto/pr65302_1.C)? See Xi Ruoyao's answer. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: C++ version for GCC development 2022-03-04 9:13 ` Jonathan Wakely @ 2022-03-04 23:03 ` Abdullah Siddiqui 0 siblings, 0 replies; 21+ messages in thread From: Abdullah Siddiqui @ 2022-03-04 23:03 UTC (permalink / raw) To: Jonathan Wakely; +Cc: Gabriel Ravier, gcc-help Hello Jonathan. Thank you again 🙂. Regards, Abdullah. On Fri, Mar 4, 2022, 4:13 AM Jonathan Wakely, <jwakely.gcc@gmail.com> wrote: > On Fri, 4 Mar 2022 at 03:07, Abdullah Siddiqui > <siddiquiabdullah92@gmail.com> wrote: > > > > Hello Jonathan. > > > > Thank you for the detailed clarification. > > > >> > 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 > > > > > > Are you referring to these lines: > > > >> ISO C++11 compiler > >> Necessary to bootstrap GCC. > >> > >> Versions of GCC prior to 11 also allow bootstrapping with an ISO C++98 > compiler,..... > > Yes, those lines. > > > > > I thought bootstrapping and compilation are two separate things. In this > context, are bootstrapping and compilation the same i.e. GCC is a compiler > and the ISO C++11 compiler is being used to compile GCC? > > Yes, that's right. > > In this context bootstrapping GCC means building it from source (which > includes compilation but also linking, and then repeating the whole > process using the just-built GCC to build itself again). > > Since GCC 11, the first stage where you build GCC with a pre-existing > compiler must be done with a C++11 compiler. Before GCC 11 a C++98 > compiler was needed. > > > > >> 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. > > > > > > Are you referring to files in the testsuite folders (example: > gcc/testsuite/g++.dg/lto/pr65302_1.C)? > > See Xi Ruoyao's answer. > ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2022-03-04 23:03 UTC | newest] Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-02-07 22:26 C++ version for GCC development 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 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
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).