logoalt Hacker News

bluGillyesterday at 5:05 PM1 replyview on HN

Sadly it is serious and in production code. (I left there 15 years ago, I suspect it isn't in production anymore)

Worse, it was a giant switch, and the target system didn't have enough memory for all the code so there were different builds and the user would select which to load.

There was code like

   case foo:
     doSomething();
   #ifdef build_two
     doSomethingElse();
     break;
   case bar:
     SomeThing();
   #endif
     MoreThings();
     break;
Try to follow that mess.

Replies

rbanffyyesterday at 9:29 PM

I’m not sure the author knew what was happening. It seems like it worked like this and they left it at that.

show 1 reply