News for hackers. Stuff that matters.
Re:The Problem with C (2020) by colonwqbang on Tuesday February 01, 2022 @06:34AM (#30161215)
A simple example would be

  auto pi = 3.14;
  double result = 2 * pi;
  printf("the circumference of the unit circle is %g\n", result);
When interpreted as C89 program, this computes the value 6. Compiled with a C++ compiler it computes 6.28. This is exactly due to that both languages have an auto keyword, but they mean different things.

This situation is perhaps not so likely to occur in real usage, but I think it could and should have been avoided.

Re:The Problem with C (2020) by foldr on Tuesday February 01, 2022 @06:44AM (#30161290)
Ah good point. I was forgetting that implicit conversion from double to int is defined.