zturner added a comment.
It would be better if we could just fix the code. If another compiler comes
along and implements this same warning, we're going to have to fix it again.
The only difference between any of this function is which cstdlib function is
called. Why not just wrap all of this and put a cast inside the wrapped
function, like:
template<> inline int as_integer(const string &func, const wstring &s, size_t
*idx, int base) {
return as_integer_helper<long,int>(func, s, idx, base, wcstol);
}
and then inside of this function put the range check and use a cast to silence
the warning.
Repository:
rCXX libc++
https://reviews.llvm.org/D41368
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits