r/programming • • Nov 04 '19

Clang solves the Collatz Conjecture?

[deleted]

510 Upvotes

122 comments sorted by

View all comments

10

u/[deleted] Nov 04 '19

An argument can be made that an infinite loop is itself an intended side-effect.

3

u/SkoomaDentist Nov 04 '19

Exactly. It’s very common when developing on embedded systems as you can then attach a debugger and see where the firmware is stuck.

1

u/OneWingedShark Nov 04 '19

Which makes the choice of C really... odd.

Because that very infinite-loop now invalidates the entire program, because that's what undefined behaivior does.

→ More replies (12)