mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Merge pull request #931 from sizeofvoid/master
fix: unsigned int value comment
This commit is contained in:
commit
c721b2c325
|
@ -12116,7 +12116,7 @@ Using `unsigned` doesn't actually eliminate the possibility of negative values.
|
||||||
|
|
||||||
unsigned int u1 = -2; // OK: the value of u1 is 4294967294
|
unsigned int u1 = -2; // OK: the value of u1 is 4294967294
|
||||||
int i1 = -2;
|
int i1 = -2;
|
||||||
unsigned int u2 = i1; // OK: the value of u2 is -2
|
unsigned int u2 = i1; // OK: the value of u2 is 4294967294
|
||||||
int i2 = u2; // OK: the value of i2 is -2
|
int i2 = u2; // OK: 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.
|
These problems with such (perfectly legal) constructs are hard to spot in real code and are the source of many real-world errors.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user