Live data from Hacker News

GCC 16 considering changing default to C++20

inbox.sourceware.org

91–100 of 119 posts

Re: GCC 16 considering changing default to C++20

#91

Earlier quoted context omitted.

You said: > This particular compiler does require bootstrapping, and that's obviously what "the compiler" is referring to in that comment. You have to pick an option: either it requires bootstrapping, or it doesn’t. As it’s possible to write the C++20 compiler features in C++11 (or whatever GCC or Clang are written in these days), it factually does not require bootstrapping.

Here, "requires bootstrapping" means "gcc needs to be able to build with gcc, including older versions of gcc."

This is going in circles and this is my last comment on it, but here is what I originally replied to:

> So you can never be perfectly bleeding edge as it'd keep you from being able to build your compiler with an older compiler that doesn't support those bleeding edge features.

…as though building the new version of the compiler depended on the features it’s implementing already existing. This is clearly not the case.

Re: GCC 16 considering changing default to C++20

#92

Earlier quoted context omitted.

Here, "requires bootstrapping" means "gcc needs to be able to build with gcc, including older versions of gcc."

This is going in circles and this is my last comment on it, but here is what I originally replied to: > So you can never be perfectly bleeding edge as it'd keep you from being able to build your compiler with an older compiler that doesn't support those bleeding edge features. …as though building the new version of the compiler depended on the features it’s implementing already existing. This is clearly not the case.

You're hallucinating a non-existent premise to the actual conversation that occurred.

The person you responded to answered the question posed by the person that they responded to. And they answered it correctly. Your "counterpoints" are counterpoints to an imaginary argument/claim that no one has actually made. The reason why it's not part of the quote that you pulled out of the other comment is that there's no way to quote the other person saying what you're trying to frame them as having said, because it's not what they were saying. This entire subthread is the result of an unnecessary attempt at a correction that doesn't manage to correct anyone about anything.

Re: GCC 16 considering changing default to C++20

#93
In the last “big” shop I worked in, we were cross-compiling all production code. Each target device had an SDK that came with a GCC and a kernel tarball, inter alia. We had a standard way to set these up. We used C++03 for years. We decided to try C++11 for userland. All the compilers supported that and after some validation, we changed permanently. Neither before the change nor after, did we rely on the absence of a “—-std=“ command line option as the means of choosing the standard for C++ or even C.

Of course we were all ADHD pedantic nerds so take this with a grain of salt.

Re: GCC 16 considering changing default to C++20

#94

Earlier quoted context omitted.

Here, "requires bootstrapping" means "gcc needs to be able to build with gcc, including older versions of gcc."

This is going in circles and this is my last comment on it, but here is what I originally replied to: > So you can never be perfectly bleeding edge as it'd keep you from being able to build your compiler with an older compiler that doesn't support those bleeding edge features. …as though building the new version of the compiler depended on the features it’s implementing already existing. This is clearly not the case.

The sentence you've quoted is explaining why a new version of the compiler cannot depend on the new features it's implementing. I.e. the first gcc version that supports C++20 cannot be written in C++20.

Which, as you say, is clearly not the case.

I have no idea how you managed to misread the comment so badly, but there we are.

Re: GCC 16 considering changing default to C++20

#95
post #46
post #32

Earlier quoted context omitted.

Seriously, why? They are broken. https://vector-of-bool.github.io/2019/01/27/modules-doa.html

This is from 2019, prior to the finalization of modules in the standard. I'd be interested in how many of these issues were unaddressed in the final version shipped.

There isn't much of a final version shipped. It's pretty well understood that modules are underspecified and their implementation across MSVC, clang, and GCC is mostly just ad-hoc based on an informal understanding among the people involved in their implementation. Even ignoring the usual complexity and ambiguity of the C++ standard, modules are on a whole different level in terms of lacking a suitable formal specification that could be used to come close to independently implementing the feature.

And this is ignoring the fact that none of GCC, clang, or MSVC have a remotely good implementation of modules that would be worth using for anything outside of a hobby project.

I agree with the other commenter who said modules are a failure of a feature, the only question left is whether the standards committee will learn from this mistake and refrain from ever standardizing a feature without a solid proof of concept and tangible use cases.

Re: GCC 16 considering changing default to C++20

#96

Earlier quoted context omitted.

This is not the case. They are discussing the default value of `g++ -std=...`. That does not complicate bootstrapping as long as the C++ sources of GCC are compatible with older and newer versions of the C++ standard.

> as long as the C++ sources of GCC are compatible with older and newer versions of the C++ standard. I've worked on a number of pretty large projects. If the target for the source code changes it can be really hard to keep C++20 features from creeping in. It means that you either need to explicitly build targeting 11, or whoever does code reviews needs to have encyclopedic knowledge of whether or not a change leaked…

The answer is obvious, YES, specify your language version. Every single compiler invocation for production (for example ci builds) should explicitly select a version. Otherwise you are asking for trouble.

Re: GCC 16 considering changing default to C++20

#97
post #64
post #6

Earlier quoted context omitted.

It's particularly jarring to basically every site I've seen it on which is usually some serious and professional looking open source site. I wonder why nobody configures this, is this not something that they can configure themselves to a more relevant image, like the GCC logo or something?

Fire up your LLM of choice and make a web extension to make it more presentable. Remove the logo, generate one, do whatever you want. The world is your playground, don’t let it “jarr” you with stuff.

[deleted]

Re: GCC 16 considering changing default to C++20

#98
post #79

Earlier quoted context omitted.

Where do you draw the line for properly supported? I've been using g++ in c++23 mode for quite some time now - even if every feature is not entirely implemented, the ones that work, work well and are a huge improvement

I draw the line where I can't expect the default gcc on most Linux and Mac systems to compile my code. And I don't want to force them to install a particular compiler. -std=c++20 seems to work pretty reliably these days. We're starting to need caniuse.com for C++.

It already exists, https://en.cppreference.com/w/cpp.html

Re: GCC 16 considering changing default to C++20

#99
post #95
post #46

Earlier quoted context omitted.

This is from 2019, prior to the finalization of modules in the standard. I'd be interested in how many of these issues were unaddressed in the final version shipped.

There isn't much of a final version shipped. It's pretty well understood that modules are underspecified and their implementation across MSVC, clang, and GCC is mostly just ad-hoc based on an informal understanding among the people involved in their implementation. Even ignoring the usual complexity and ambiguity of the C++ standard, modules are on a whole different level in terms of lacking a suitable formal specifi…

Today I learnt that Office is an hobby project.

Re: GCC 16 considering changing default to C++20

#100
post #99
post #95

Earlier quoted context omitted.

There isn't much of a final version shipped. It's pretty well understood that modules are underspecified and their implementation across MSVC, clang, and GCC is mostly just ad-hoc based on an informal understanding among the people involved in their implementation. Even ignoring the usual complexity and ambiguity of the C++ standard, modules are on a whole different level in terms of lacking a suitable formal specifi…

Today I learnt that Office is an hobby project.

You learned nothing because the extent of your knowledge tends to be rather superficial when it comes to C++.

Office does not use C++ modules, what Office did was make use of a non-standard MSVC feature [1] which reinterprets #include preprocessor directives as header units. Absolutely no changes to source code is needed to make use of this compiler feature.

This is not the same as using C++20 modules which would require an absolutely astronomical amount of effort to do.

In the future, read more than just the headline of a blog post if you wish to actually understand a topic well enough to converse in it.

[1] https://learn.microsoft.com/en-us/cpp/build/reference/transl...

Post reply on HN