Avoiding compiler issues with abs()
<p>When using the <code>double</code> variant of the <code>std::abs()</code> function without the <code>std</code> with g++ 4.6.1, no warning or error is given.</p>

<pre><code>#include &lt;algorithm&gt;
#include &lt;cmath&gt;

double foobar(double a)
{
     return abs(a);
}
</code></pre>

<p>This version of g++ seems to be pulling in the <code>double</code> variant of <code>abs()</code> into the global namespace through one of the includes from <code>algorithm</code>. This looks like it is now allowed by the standard (see this <a href="http://stackoverflow.com/questions/4405887/when-the-c-standard-provides-c-headers-bringing-names-into-the-global-namespac">question</a>), but not required.</p>

<p>If I compile the above code using a compiler that does not pull the <code>double</code> variant of <code>abs()</code> into the global namespace (such as g++ 4.2), then the following error is reported:</p>

<pre><code>warning: passing 'double' for argument 1 to 'int abs(int)'
</code></pre>

<p>How can I force g++ 4.6.1, and other compilers that pull functions into the global namespace, to give a warning so that I can prevent errors when used with other compilers?</p>
