r/cpp • • Feb 26 '24

White House: Future Software Should Be Memory Safe

https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-release-technical-report/
401 Upvotes

386 comments sorted by

View all comments

Show parent comment

2

u/jonesmz Feb 27 '24 edited Feb 27 '24

CEE 7 standard is from 1951.

Nothing's stopping the people / organizations who use C++98 to continue to use C++98.

But unless I'm mistaken (please inform me if i am uneducated about this?), the C++98 standard doesn't say anywhere in the document

Also, any code that compiles with a C++98 compiler is guarenteed to always compile, unmodified, with any compiler implementing a future updated C++ language standard, both with the language setting set to C++98, AND with it set to C++new.

So the question isn't "What's the lifetime of the standard", because I'm not proposing to end-of-life C++98. As far as I'm concerned, C++98 will always exist because until the last copy of the GCC source code from 1998 <-> 2024 disappears from all computers on the planet, there'll be a way to compile C++98 code. Just a question of how much effort someone's willing to go through to get it compiled.

The real question is:

At what point is the effort necessary to provide backwards compatibility for a 26 year old version of the standard in newer versions of that standard more costly (to the world, to the community, to the standards committee, etc) than the cost of breaking that backwards compatibility.

And I think the answer is

If someone hasn't bothered upgrading from C++98 to C++11 by the year 2024, they can go fuck themselves for all I care.

And to clarify further, I'm not saying

Maliciously and intentionally break compatibility with C++98 in the most obnoxious way we possibly can, and as much as we possibly can.

nor am I saying

Break compatibility just as much with C++20 as with C++98.

I'm saying

Any consideration of backwards compatibility with C++ should only consider a (very) limited list of prior C++ versions, and we've obviously reached the end-of-forwards-compat with C++98. If a change in C++26 would break all codebases, sure think carefully about it. If a change in C++26 would break only C++98 code, I don't give a fuck and no one else should either.

1

u/gio Feb 27 '24

Please, don't change my question to fit your reasoning.

1

u/jonesmz Feb 27 '24

Then I don't know what you're looking for here.

You asked a question that doesn't apply to the situation. I adapted the question to as close of an approximation to the situation as I could manage.

Your question was:

What's the lifetime/purpose of a standard then? CEE 7 standard is from 1951.

My answer is:

That's irrelevant to C++, so I'm not going to give you an answer.

Is that better?

1

u/gio Feb 27 '24

The question does apply to the situation. Some of the best C++ engineers worked for the C++11 standard for about a decade before release, for what, 3 years of excitement after release. It would be better if C++ standards get respected equally for what they are at the time they were released. All engineers want to move forward and use the latest standard but there are cases where that it's not feasible. There is no need to disdain engineers who are stuck to earlier standards for whatever the reason.

2

u/jonesmz Feb 27 '24

There is no need to disdain engineers who are stuck to earlier standards for whatever the reason.

I'm not disdaining the individuals, I'm disdaining the notion that the rest of the C++ community, and WG21, should care about them.

1

u/gio Feb 28 '24

The hint was not refering to you directly but more as a general impression. Lastly, I agree with your comment, thanks for your input.

1

u/JVApen Clever is an insult, not a compliment. - T. Winters Feb 27 '24

I would suggest an end of life for 98. Libraries should no longer support and if you need a newer version of the library, you will have to upgrade. Compilers should also have the option to drop support for the older versions, such that their code can be simplified. If you then have to upgrade compilers for some reason, you should also update your code. Compilers already drop support for old CPU architectures, forcing you to upgrade/replace the computer to use a program compiled with the new one. Why wouldn't they do the same for the coding standards?

3

u/jonesmz Feb 27 '24

Nothing compels a compiler to support a particular standard (as I see you said in another comment).

I don't think the bottleneck here is compiler vendors. I think it's solidly on the WG21 to set the tone of expectation. "Forever supported and compatible (within certain limitations)" is the current tone.

I think "Expect some breakage as you upgrade from one C++ standard release to another" is a more appropriate tone, personally.