M
Mantorok Redgormor
If I do something like the following:
unsigned int bar=10;
Then use, -bar with the unary '-' and assign this value to an int,
does this invoke undefined behavior in anyway?
Basically I have:
unsigned int bar=10;
int foo;
foo = -bar; /* Undefined behavior? */
I'm just wondering if this value that is expressed in the expression
-bar can be representable at all times with the int variable and in no
way ends up invoking undefined behavior
unsigned int bar=10;
Then use, -bar with the unary '-' and assign this value to an int,
does this invoke undefined behavior in anyway?
Basically I have:
unsigned int bar=10;
int foo;
foo = -bar; /* Undefined behavior? */
I'm just wondering if this value that is expressed in the expression
-bar can be representable at all times with the int variable and in no
way ends up invoking undefined behavior