by frankjr · 4y ago · 0 comments
You really don't. The vast majority of projects will never change the language version they use. Simple projects are simple to fix. Remaining large projects have enough resources and expertise to do changes across their entire code base - Chromium has recently changed more than 15000 instances (in over 8000 files) of using raw pointers to using raw_ptr instead in a single pull request [0]. How? They wrote a Clang based tool which did it automatically [1].
[0] https://chromium-review.googlesource.com/c/chromium/src/+/33...
[1] https://source.chromium.org/chromium/chromium/src/+/main:too...
Now, many languages, including C++, have gotten away with smaller backwards-incompatible changes (e.g. C++ 17 removed dynamic exception specifications from the language entirely - getting away with it because it was an almost entirely unused non-feature).
Edit: removed some reference to PHP6 where I had a wrong recollection.
A more common example, what if a library that you use stops supporting the old version, and the latest compatible release of the library has a security vulnerability.
I'm talking about using the same language version (standard), not compiler version - e.g. the latest Clang still supports the C++98 ISO version.
> A more common example, what if a library that you use stops supporting the old version, and the latest compatible release of the library has a security vulnerability.
You backport the fix or the change library. Nobody said it's easy but your project should not hold the entire language hostage.