C as a portable assembly: porting RAEdit to 64-bit
rammichael.com
rammichael.com
GCC displayed more than 1,000 warnings, most of which complain about
incompatibility of types. I was actually surprised that it was able
to compile.
Probably it did.This is a somewhat extreme case, as code that depends on the behavior of signed overflow is rare, but there's a lot of things that are perfectly well specified by the architecture, but that C leaves undefined.
This series (among many other places on the internet) does a good job explaining the problems http://blog.llvm.org/2011/05/what-every-c-programmer-should-...
[edit: after looking at the "C" code, I guess not -- this really is asm wrapped in C (which is perfectly ok)]
i'd be curious how reliable your port is too. automated code conversion can introduce subtle and unexpected bugs in a ton of cases... did you measure it somehow?
This goes back to the days when the code generated by C, Pascal, Modula-2 and many other compilers were deemed too slow for home computers and real developers used Assembly.
But since those languages weren't married to UNIX, they lost.
EDIT:
Forgot to mention that actually my whole point was about the title " C as a portable assembly: ...".