The C language is infamous for not specifying the size and format of the built-in types:

  • A "byte" (char) can be anything from 8 bits and up
  • An "int" can be any number of chars as long as it fits a minimum number of values
  • Integers are not required to use every bit
  • Not all bit patterns in an integer has to be valid
  • Signed integers are not necessarily two's-complement
  • ...and more!

There is a hypothetical computer called the DeathStation 9000 designed to break every assumption simultaneously.

However, I don't own this machine, so now I am looking for a proof-of-concept C compiler that can be configured to vary a lot of these features. A hypothetical example:

deathcc --char_bits=13 --ones-complement --endian=interleaved main.c

I would like such a compiler to check for possible portability issues.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.