J
JKop
Would you classify the following code as "Undefined Behaviour" or as "Non-
portable"?
signed main()
{
signed char chedder = 130;
}
Relevant information:
1) Minimum range for a signed char: -127 to 127
2) Overflow for a signed integral type is Undefined Behaviour
3) There's no maximum range for a signed char
If the program is run on a system with a 9-Bit char, then there's no
overflow, and as such there's no Undefined Behaviour.
But overall would you classify it as "Undefined Behaviour" or "Non-
portable"?
-JKop
-JKop
portable"?
signed main()
{
signed char chedder = 130;
}
Relevant information:
1) Minimum range for a signed char: -127 to 127
2) Overflow for a signed integral type is Undefined Behaviour
3) There's no maximum range for a signed char
If the program is run on a system with a 9-Bit char, then there's no
overflow, and as such there's no Undefined Behaviour.
But overall would you classify it as "Undefined Behaviour" or "Non-
portable"?
-JKop
-JKop