[PATCH] D41368: [libc++] Ignore bogus tautologic comparison warnings

Zachary Turner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 15:15:05 PST 2017

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.

  rCXX libc++


More information about the cfe-commits mailing list