3 ms·
That you could easily port an old C code to modern compilers seems doesn't seem to be in contradiction to the statement that old code will not compile as is.
by SiempreViernes 7y ago
That you could easily port an old C code to modern compilers seems doesn't seem to be in contradiction to the statement that old code will not compile as is.
- jacquesm 7y agoA couple of lines change does not qualify as a port to me. It was less of a change than from one minor release of a modern language to another.
- vkazanov 7y agoPrior to the ANSI standard there were many C compilers on different machines with different architectures. Some compilers included support for architecture-specific things, like segmented memory, etc. Others allowed to do cross-function gotos. Types were not very well defined. Event the original language grammar from the book is only useful as an idea of what the language should be like, not as a proper syntax definition, I am not even talking about semantics here. The code I had to deal with (written for 16-bit x86) had to be rewritten, it was definitely not a "fix-here-and-there" thing. It was fine, written by reasonable programmer and completely readable so I was able to understand and rewrite it in a week. You probably were very lucky with that project of yours. Even the way we have it nowadays C is... hard to formalise.