About DeathStation 9000

What the hell is a DeathStation 9000?

The DeathStation 9000 (often shortened to DS9K) is a mythical machine that implements the C standard in a particularly brutal way. If you invoke undefined behaviour on the DeathStation 9000, the code can do anything, including making demons fly out of your nose.

Undefined behaviour was a genius idea and made C really portable. For instance, writing to a string constant invokes undefined behaviour. This means that on a modern OS like UNIX it's free to trigger a segmentation fault. Whereas on a machine without memory management it could simply allow the write without erroring. In both cases the behaviour is undefined.

It also allows compiler writers to optimise certain situations. For example:

void func(unsigned char c)
{
    int i = 12345678;

    i += c;

    if (i < 12345678)
    {
        do_something();
    }
}

In this situation the compiler can know that the condition in the if will never be true. The value being added is unsigned, so can't be a negative number and if the value overflowed behaviour is undefined so that doesn't matter.

Why write all this useless software that no-one ever uses?

Well, when you have the social skills of Genghis Khan you have to fill the time somehow. In between games of MAP32 on Final Doom - The Plutonia Experiment anyway.

And of course I still live under the illusion that I can code as well as Jeff Minter.