Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: base/numerics/safe_math_impl.h

Issue 2506093004: Protect base/numerics against change in intmax_t's underlying type (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/numerics/safe_math_impl.h
diff --git a/base/numerics/safe_math_impl.h b/base/numerics/safe_math_impl.h
index 71fc278b297c26f7bf51ec695a3baacdb977e961..e6de6c85d5e338781aaeb5ef1070f0defca9a101 100644
--- a/base/numerics/safe_math_impl.h
+++ b/base/numerics/safe_math_impl.h
@@ -57,6 +57,8 @@ struct IntegerForSizeAndSign<8, true> {
template <>
struct IntegerForSizeAndSign<8, false> {
typedef uint64_t type;
+ static_assert(sizeof(uintmax_t) == 8,
Tom Sepez 2016/11/17 17:04:54 nit: Do you want a <= or >= comparison here? Does
jschuh 2016/11/17 18:06:46 Good question. I can't really test, but I've seen
+ "Max integer size not supported for this toolchain.");
};
// WARNING: We have no IntegerForSizeAndSign<16, *>. If we ever add one to
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698