Hello Team TI,
I have a few errors based on the warnings below:
Errors: Description Resource Path Location Type
#1851 case label value has already appeared in this switch at line 275
#1851 case label value has already appeared in this switch at line 275
#1851 case label value has already appeared in this switch at line 275
#1851 case label value has already appeared in this switch at line 275
#1851 case label value has already appeared in this switch at line 276
#1851 case label value has already appeared in this switch at line 276
#1851 case label value has already appeared in this switch at line 276
#1851 case label value has already appeared in this switch at line 276
#1851 case label value has already appeared in this switch at line 277
#1851 case label value has already appeared in this switch at line 277
#1851 case label value has already appeared in this switch at line 277
#1851 case label value has already appeared in this switch at line 278
#1851 case label value has already appeared in this switch at line 278
#1851 case label value has already appeared in this switch at line 279
Warnings:
#64-D shift count is too large
#64-D shift count is too large
#64-D shift count is too large
#64-D shift count is too large
#64-D shift count is too large
#64-D shift count is too large
#64-D shift count is too large
#69-D integer conversion resulted in a change of sign
The code due to which the errors and warnings are created as below:
enum XYZ
{
A = 1<< 0
,B = 1<< 1
,C = 1<< 2
,D = 1<< 3
,E = 1<< 4
,F = 1<< 5
,G = 1<< 6
,H = 1<< 7
,I = 1<< 8
,J = 1<< 9
,K = 1<<10
,L = 1<<11
,M = 1<<12
,N = 1<<13
,O = 1<<14
,P = 1<<15
,Q = 1<<16
,R = 1<<17
,S = 1<<18
,T = 1<<19
,U = 1<<20
,V = 1<<21
,W = 1<<22
};
inline const char* ANYNAME(unsigned FOREXSTATUS)
{
const char* CONSTValue = "UNKNOWN";
switch(FOREXSTATUS)
{
case A: CONSTValue = "A"; break;
case B: CONSTValue = "B"; break;
case C: CONSTValue = "C"; break;
case D: CONSTValue = "D"; break;
case E: CONSTValue = "E"; break;
case F: CONSTValue = "F"; break;
case G: CONSTValue = "G"; break;
case F: CONSTValue = "F"; break;
case H: CONSTValue = "H"; break;
case I: CONSTValue = "I"; break;
case J: CONSTValue = "J"; break;
case K: CONSTValue = "K"; break;
case L: CONSTValue = "L"; break;
case M: CONSTValue = "M"; break;
case N: CONSTValue = "N"; break;
case O: CONSTValue = "O"; break;
case P: CONSTValue = "P"; break;
case Q: CONSTValue = "Q"; break;
case R: CONSTValue = "R"; break;
case S: CONSTValue = "S"; break;
case T: CONSTValue = "T"; break;
case U: CONSTValue = "U"; break;
case V: CONSTValue = "V"; break;
}
return CONSTValue;
}
The problem is I can't change the type of the variable in the header file, due to which there are errors. The other projects are using the same header file but the different compilers and work well.
Even after typecasting 1 to UL, removes the warnings but not the errors. because there is enum size is 16 bit by default?
How can I change the enum size to 32 or bigger ?
So, what could be the solution to take care of this kind of error?
Thanks,
VP