C 中的所有标识符在使用前都需要声明,但我找不到它在 C99 标准中表示的位置。
我觉得也是指宏定义,不过定义的只是宏展开顺序。
最佳答案
C99:TC3 6.5.1 §2,脚注 79 明确指出:
Thus, an undeclared identifier is a violation of the syntax.
结合 6.2.1 §5:
Unless explicitly stated otherwise, [...] it [ie an identifier] refers to the entity in the relevant name space whose declaration is visible at the point the identifier occurs.
和§7:
[...] Any other identifier has scope that begins just after the completion of its declarator.
关于使用前的 C 声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4804844/