Is there a GCC warning for using symbols from the C library not through namespace std?
问题 Consider the following (buggy) C++ code: #include <cmath> #include <cstdlib> #include <iostream> int main() { if (abs(-0.75) != 0.75) { std::cout << "Math is broken!\n"; return 1; } else { return 0; } } This code is buggy because it calls abs (meaning ::abs ) instead of std::abs . Depending on the implementation, ::abs might not exist, or it might be the C abs , or it might be an overload set including a version for double , like std::abs is. With Clang on Linux, at least in my environment,