我不明白为什么这段代码会编译?
#include <stdio.h> void foo() { printf("Hello\n"); } int main() { const char *str = "bar"; foo(str); return 0; }
gcc甚至没有发出警告,我向foo()传递了太多的参数.这是预期的行为吗?
c gcc compiler-errors
c ×1
compiler-errors ×1
gcc ×1