如果我使用 clang 工具,建议使用 clang 或 clang 工具链的某些部分来告诉我,例如将 an 传递int给需要 a 的函数short可能是一个坏主意?
鉴于这个非常简单的程序
static short sus = 0;
void foo(short us) {
sus = us;
}
int main() {
int i = 500000;
foo(i); // any indication from clang this might be a bad idea
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我一定错过了一些非常简单的东西,对吧?