<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 6, 2014 at 3:48 PM, James Dennett <span dir="ltr"><<a href="mailto:jdennett@googlers.com" target="_blank">jdennett@googlers.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Jan 6, 2014 at 12:30 PM, Marshall Clow <<a href="mailto:mclow.lists@gmail.com">mclow.lists@gmail.com</a>> wrote:<br>

><br>
>   Two questions:<br>
>   * Is this meant to be just for ‘abs’, or will it be generalized for all the calls in <math.h>?<br>
>   * What about in C++ code, where there can be many functions named “abs” that take different arguments? What will this patch do in that case?<br>
>   [ Ok, they’re named std::abs, but people hoist them into the global namespace _all the time_ ]<br>
<br>
</div>People including authors of <math.h> if they get it right; it should<br>
provide the same overload set as <cmath> (and similarly for <stdlib.b><br>
and <cstdlib>).  (Appendix D of the C++ standard describes this<br>
behavior for the C compatibility headers.)<br>
<br>
However, some (most?) implementations of <math.h> and/or <stdlib.h> do<br>
get this wrong.  We shouldn't assume that they have the right<br>
overloads in the global namespace, but we also shouldn't assume that<br>
they don't.<br></blockquote><div><br>This warning looks for extern "C" functions named abs (and labs, fabs, etc), so I don't think it will fire if the right overload was declared math.h and found by overload resolution.</div>
</div></div></div>