3 ms·
Is that a requirement that is relevant presently? I would say not so much. Do modern C compilers also make only a single pass?
by billfruit 3y ago
Is that a requirement that is relevant presently? I would say not so much. Do modern C compilers also make only a single pass?
- hulitu 3y agoYes. Gcc throws errors like hell with c files which have the definitions after functions.
- rezonant 3y agoModern compilers still have to follow the rules of the language.
- billfruit 3y agoYes, but is the constraint that compiler shall make only a single pass, a rule of the language?
- trealira 3y agoPrior to C99 (i.e., in C90), there was a rule that any undeclared identifier id that was followed by a function call parenthesis would be treated as though there were an implicit declaration in the scope in which it was used like this: extern int id(); The empty parentheses meant it could take any number of arguments, since it was declared in the traditional style, where the argument types weren't specified first. This implicit declaration meant that if it was later defined in the same file as returning a type other than int, the compiler wasn't permitted to go back up in the file and treat the function call as though it returned a type other than int. This requirement was removed in C99, but in practice, compilers kept doing it for backwards compatibility, even when not invoked in C90 mode.