From 7146b55d303794594065a0c1cfb8a0762ccc1bf6 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Mon, 11 Sep 2017 10:36:50 -0700 Subject: [PATCH] Fix #1008. --- CppCoreGuidelines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index ff2d2d7..223e202 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -12661,10 +12661,10 @@ Using `unsigned` doesn't actually eliminate the possibility of negative values. ##### Example - unsigned int u1 = -2; // OK: the value of u1 is 4294967294 + unsigned int u1 = -2; // Valid: the value of u1 is 4294967294 int i1 = -2; - unsigned int u2 = i1; // OK: the value of u2 is 4294967294 - int i2 = u2; // OK: the value of i2 is -2 + unsigned int u2 = i1; // Valid: the value of u2 is 4294967294 + int i2 = u2; // Valid: the value of i2 is -2 These problems with such (perfectly legal) constructs are hard to spot in real code and are the source of many real-world errors. Consider: