考虑这段代码(t0.c):
typedef int T;
void f(int T);
调用:
gcc -std=c11 -Wall -Wextra -pedantic -c t0.c
<nothing>
clang -std=c11 -Wall -Wextra -pedantic -c t0.c
<nothing>
cl /std:c11 /Za /c t0.c
t0.c(2): warning C4224: nonstandard extension used: formal parameter 'T' was previously defined as a type
问题:
- 哪些 C 规则允许在函数声明器中使用之前定义为类型的标识符?
- 如果 msvc 说
nonstandard extension
,那么为什么符合标准的 gcc / clang 什么都不说?