Functions & Parameter Passing


Answer & solution
Answer: A under C90; modern C needs a diagnostic (no official key was published)
The printed line is fro(I=0, I<N, I++); with commas, not semicolons. Lexically fro is a valid identifier, and syntactically this is a function call with three arguments, not a for statement. Under the historical C90 implicit-function-declaration rule, an object module can be produced, so A is the intended compilation-stage answer; a missing definition may fail at link time. In C99 and later the undeclared function requires a diagnostic, but this is not a lexical or grammar error of the kind offered. The argument side effects also give undefined runtime behavior under C90 because I is modified more than once without an intervening sequence point; no runtime result is asserted. The paper preserve fro and commas.
The lexer accepts fro as an ordinary identifier. The grammar accepts the following parentheses as a function call whose three arguments are I=0, I<N, I++. Thus misspelling for does not by itself create a lexical or grammar error. Older C allowed an implicit function declaration; an undefined fro may be discovered later by the linker. Modern C requires a diagnostic for the undeclared function, and runtime side effects are separately problematic. The intended old compilation-stage answer must not be presented as portable modern C.