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. -- James _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
