4 ms·
> Tangent, but why is it inaccurate that C is described as "portable assembler" ? - Strict aliasing rules (most important reason why C should not be considered
by wolfgke 10y ago
> Tangent, but why is it inaccurate that C is described as "portable assembler" ?
- Strict aliasing rules (most important reason why C should not be considered as "portable assembler")
- Overflow for adding/subtracting signed numbers is undefined behavior
- Implicit casting of integer types in expressions; OK, there are rules for this, but under assembly you have all this under direct control without having to learn lots of arcane rules
- There are things that can easily be done in assmbly that cannot/can hardly be done in C (for example taking adress of a label (very useful for implementing coroutines) is only an GCC extension but not standard C: http://stackoverflow.com/q/1777990/497193 http://stackoverflow.com/q/1777990/497193). Or how do you control the amount of stack space that a function is allowed to use (would be very useful for embedded applications where you strictly want to avoid stack overflow and you want to allocate exactly as much stack space as necessary, but not more)