|
|
|
|
|
by rand_flip_bit
1105 days ago
|
|
As another commenter pointed out, this is obsolete C, however: this is just not how modern compilers work. at all. Compilation is performed in phases, you have syntax analysis, semantic analysis, and then optimization and codegen. It’s trivial for a compiler to handle this code, heck C++ compilers (which your C compiler is under the hood) already do this for struct/classes (allowing member functions to be called before being declared). Pretty much every other language supports this too, but universally and not just in classes. We’ve come a long way since the 60’s. |
|
Single-pass compilation is very pertinent. One tenet of c's design is that it should be compilable in a single pass (which is why it is compilable in a single pass, unlike many other programming languages). This is relevant to us because it allows us to make predictions about the language; in particular, if the addition of some feature would cause c to not be compilable in a single pass, we can predict that the feature will not be added to the language. Notice that I have not made any value judgments. You may disagree about the importance of supporting single-pass compilers, but I am not the person you need to convince of that.