Weird bug or bad code
a_riot42
Posts: 1,624
I noticed something odd the other day, I have a switch statement where the cases are literal strings.
It all compiles and works correctly except for the case above. If I make the literal 2 characters like 'MM' no problem. If I leave it with one character 'M' I get the famous:
ERROR: (0): C10580: Internal Error: Major system error occurred during code generation
error.
Anyone seen this as well or is my code bad?
Paul
switch(sName) { case 'M': { // some code } }
It all compiles and works correctly except for the case above. If I make the literal 2 characters like 'MM' no problem. If I leave it with one character 'M' I get the famous:
ERROR: (0): C10580: Internal Error: Major system error occurred during code generation
error.
Anyone seen this as well or is my code bad?
Paul
0
Comments
Try this thread:
http://www.amxforums.com/showthread.php?7172-Switch...Case-problem&p=49428#post49428
http://www.amxforums.com/showthread.php?1740-post-54
There are other posts that discuss switch cases using decimal values in ascending order or was it descending? Anyways switch/case have a bunch of quircks. Fortunately you got the compiler error and not code that runs with un-anticipated results.
If I recall NMarkRoberts also had posts on this subject back in the day. Wonder what ever became of him?
Paul