News for hackers. Stuff that matters.
Re:Coroutines in C (2000) by iokevins on Saturday February 06, 2016 @10:06PM (#11051377)
Today I learned: "PuTTY is a Win32 Telnet and SSH client. The SSH protocol code contains real-life use of this coroutine trick. As far as I know, this is the worst piece of C hackery ever seen in serious production code."
Re:Coroutines in C (2000) by O5vYtytb on Saturday February 06, 2016 @11:48PM (#11051660)
Wow,no kidding https://github.com/Yasushi/putty/blob/31a2ad775f393aad1c31a9...

It's beautiful and incredibly scary at the same time.

Re:Coroutines in C (2000) by majke on Sunday February 07, 2016 @12:13AM (#11051727)
just wow, from the snippet you linked:

  *  - right-click ssh.c in the FileView
  *  - click Settings
  *  - select the C/C++ tab and the General category
  *  - under `Debug info:', select anything _other_ than `Program
  *    Database for Edit and Continue'.
Right, so in order to compile the thing you need to click "something other than". That doesn't sound deterministic.
Re:Coroutines in C (2000) by becauseICan on Sunday February 07, 2016 @04:15AM (#11052278)
That's ensuring the compiler obeys some behaviors of an ANSI C compiler when debugging in MS Visual Studio. That strikes me as the kind of practice that would improve determinism. The explanation is given on the line before your quote.

That said, I can't believe this exists in the wild.