title: Is there a GCC warning for using symbols from the C library not through namespace std?
body: <p>Consider the following (buggy) C++ code:</p>
  
  <pre><code>#include &lt;cmath&gt;
  #include &lt;cstdlib&gt;
  
  #include &lt;iostream&gt;
  
  int main() {
      if (abs(-0.75) != 0.75) {
          std::cout &lt;&lt; "Math is broken!\n";
          return 1;
      } else {
          return 0;
      }
  }
  </code></pre>
  
  <p>This code is buggy because it calls <code>abs</code> (meaning <code>::abs</code>) instead of <code>std::abs</code>. Depending on the implementation, <code>::abs</code> might not exist, or it might be the C <code>abs</code>, or it might be an overload set including a version for <code>double</code>, like <code>std::abs</code> is.</p>
  
  <p>With Clang on Linux, at least in my environment, it turns out to be the second option: C <code>abs</code>. This provokes two warnings, even without explicitly enabling any:</p>
  
  <pre><code>&lt;source&gt;:7:9: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
      if (abs(-0.75) != 0.75) {
          ^
  &lt;source&gt;:7:9: note: use function 'std::abs' instead
      if (abs(-0.75) != 0.75) {
          ^~~
          std::abs
  &lt;source&gt;:7:13: warning: implicit conversion from 'double' to 'int' changes value from -0.75 to 0 [-Wliteral-conversion]
      if (abs(-0.75) != 0.75) {
          ~~~ ^~~~~
  </code></pre>
  
  <p>On GCC, I get different results in different environments and I haven’t yet figured out what details of the environment are relevant. The more common option, though, is also that it calls the C <code>abs</code> function. However, even with <code>-Wall -Wextra -pedantic</code>, it gives no warnings. I can force a warning with <code>-Wfloat-conversion</code>, but that gives too many false positives on the rest of my codebase (which perhaps I should fix, but that’s a different issue):</p>
  
  <pre><code>&lt;source&gt;: In function 'int main()':
  &lt;source&gt;:7:18: warning: conversion to 'int' alters 'double' constant value [-Wfloat-conversion]
       if (abs(-0.75) != 0.75) {
                    ^
  </code></pre>
  
  <p>Is there a way to get a warning whenever I use a library function through the global namespace, when the version in namespace <code>std</code> is an overload?</p>