News for hackers. Stuff that matters.
Re:C++26: Trivial infinite loops are no longer undefined beh... by andrepd on Friday September 18, 2026 @02:17PM (#49758146)
An empty loop, under some non-obvious conditions, on some compiler flags but not others, silently transforms into a system call. In a systems programming language.
Re:C++26: Trivial infinite loops are no longer undefined beh... by WalterBright on Friday September 18, 2026 @06:13PM (#49760944)
I try to minimize use of destructors for the same reason.
Re:C++26: Trivial infinite loops are no longer undefined beh... by andrepd on Friday September 18, 2026 @07:00PM (#49761393)
Destructors run predictably at list, and are pervasive everywhere. You know that when you exit a scope, be that a function or whatever it may, the destructors of variables in that scope are called. That is clear and consistent. The transformation mentioned above is not.
Re:C++26: Trivial infinite loops are no longer undefined beh... by WalterBright on Friday September 18, 2026 @07:46PM (#49761791)
Understanding the code requires understanding the destructors of the objects you're using. Since they are invisibly inserted, they are a source difficulty in entirely understanding the code.
Re:C++26: Trivial infinite loops are no longer undefined beh... by rcxdude on Friday September 18, 2026 @08:07PM (#49761925)
I do wonder if any of the language servers that insert implied type annotations would ever also show things like destructor calls in a similar manner. It seems like it would be quite useful.
Re:C++26: Trivial infinite loops are no longer undefined beh... by otabdeveloper4 on Saturday September 19, 2026 @02:57AM (#49764055)
> Since they are invisibly inserted

They're not, all destructors are explicit. Seems like a skill issue on your end.

Re:C++26: Trivial infinite loops are no longer undefined beh... by WalterBright on Saturday September 19, 2026 @03:26AM (#49764206)
Since AFAIK I'm still the only person to write a correct C++ (C++98) compiler from preprocessor to object file, I know all about destructors.

Here's a fun one for your amusement:

    foo(a, b, c);
The parameters are pass by value. a, b and c are objects that have destructors. Have a look at the code generated for that.

It is nice that the compiler does the dirty work for you, but the various paths with exceptions and recovery with invisible code may not be well tested.

Re:C++26: Trivial infinite loops are no longer undefined beh... by degaart on Sunday September 20, 2026 @02:05AM (#49772906)
> Seems like a skill issue on your end.

You're talking to walter bright, the guy who wrote the digital mars C++ compiler

Re:C++26: Trivial infinite loops are no longer undefined beh... by otabdeveloper4 on Monday September 21, 2026 @12:03AM (#49782931)
> appeal to authority

Okay.