-3

Context ( You can skip )

I will be doing a presentation on Python, and will be touching upon V3's decision to be intentionally backwards incompatible, and how that has affected Python long term. I will be examining in particular their decision to remove the print keyword, because it was a decision that was not strictly neccessary. [ as far as I know ]

However, in order to be fair to the language, I wish to examine where C and C++ have done similar in their past, where they intentionally released a spec that when implimented, would definitely break existing code. I had tried asking around about this, and really only found one particular instance:

Why exactly was the C++ convenience of not requiring a second declaration, removed?

However it seems so esoteric of an example that it can hardly be considered relevant. I get the impression that breakages are actually quite frequent upon every C++ release, it is just not clear to me whether those breakages are bugs/oversights, or rather intentional breakages/deprecations introduced into the spec.


Actual Question:

Regarding C or C++

  • What is an instance where a change was introduced to the spec, that would knowingly break backwards compatibility?
    • [ To be clear, where old code ceases to be valid or compileable under an updated specification ]

Optional Details of Interest:

  • What was the rationalization for this change?
  • Was it absolutely neccessary?
  • How did compilers generally handle the change?
    • For example, were compatibility flags introduced? Were compiler warnings added before the change was finally implimented?
  • Were there any significant negative externalities which resulted from this change?
    • For example, years long endeavours to bring a large library up to spec?
  • In hindsight, was the decision made ultimately the best one, or were those involved in the change, express any sort of regret?

Thank you.

Anon
  • 3,565
  • 3
  • 27
  • 45
  • 4
    Questions asking for long lits of things are not well suited for this site. But you can lookup the breaking changes at the official standards, as Caleth pointed out. Unfortunately, asking for 3rd party resources is off-topic for the site. If you ask me for a change similar to the change from Python2 to Python3, I think Stroustrup intentionally chose to make C++ not 100% backwards compatible to C, for the purpose of creating a more powerful language. – Doc Brown Jan 20 '23 at 10:00
  • 1
    Closed now, but the C++ breakages have tended to be in obscure corners and not to affect most codebases, while the print change affected almost every single script, and (more importantly) the unicode change broke almost every single piece of text handling. Also, you can often use older C++ libraries in updated programs, while the same was not true of python and crippled the upgrade. – pjc50 Jan 20 '23 at 13:57
  • 2
    There was a certain amount of breakage *before* standardisation, but that was way back in the 90s. It's like asking about pre-ANSI C. – pjc50 Jan 20 '23 at 14:00

1 Answers1

2

The (draft) International Standards list all the breaking changes in Annex Cā€ƒ(informative) Compatibility [diff]

How did compilers generally handle the change?

Popular C++ compilers have options to target specific versions of the language, e.g. passing a command line argument to the invocation

Caleth
  • 10,519
  • 2
  • 23
  • 35