On Mon, Jan 6, 2014 at 3:48 PM, James Dennett <[email protected]> wrote:
> On Mon, Jan 6, 2014 at 12:30 PM, Marshall Clow <[email protected]> > wrote: > > > > Two questions: > > * Is this meant to be just for ‘abs’, or will it be generalized for > all the calls in <math.h>? > > * 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? > > [ Ok, they’re named std::abs, but people hoist them into the global > namespace _all the time_ ] > > People including authors of <math.h> if they get it right; it should > provide the same overload set as <cmath> (and similarly for <stdlib.b> > and <cstdlib>). (Appendix D of the C++ standard describes this > behavior for the C compatibility headers.) > > However, some (most?) implementations of <math.h> and/or <stdlib.h> do > get this wrong. We shouldn't assume that they have the right > overloads in the global namespace, but we also shouldn't assume that > they don't. > 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.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
