Summary:
* folly/Format-inl.h (IndexableTraitsSeq::at): Add an explicit
int-to-size_t cast (ok here, since we've just confirmed
that the value is not negative) to avoid this error from gcc-4.9:
folly/Format-inl.h:947:29: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: tjackson@fb.com
Subscribers: trunkagent, net-systems@, folly-diffs@
FB internal diff:
D1770193
Tasks:
5941250
Signature: t1:
1770193:
1420670569:
83ac19c2ca8cd408d7c86d7dce49e2d4b418941a
static const value_type& at(const C& c, int idx,
const value_type& dflt) {
- return (idx >= 0 && idx < c.size()) ? c.at(idx) : dflt;
+ return (idx >= 0 && size_t(idx) < c.size()) ? c.at(idx) : dflt;
}
};