pea
developer
Hi all,
I am compiling code that gets the following warning:
in relation to the following code:
And, yes, it does have an array subscript of type char, but who cares?? What does the compiler care?
On a related note - i have always learned that you should choose the datatype that best matches the range of data that you are expecting (e.g. unsigned char for anything that won't go over 255). But is it better to just use 'int' anyway because it is the native 32 bit variable? Will it be more efficient using an int over a char (for example, array subscripts, additions and other math, shifts etc)?
I am compiling code that gets the following warning:
Code:
warning: array subscript has type `char'
Code:
unsigned short level;
char a=1;
level = &gp_alphaLUT[a];
And, yes, it does have an array subscript of type char, but who cares?? What does the compiler care?
On a related note - i have always learned that you should choose the datatype that best matches the range of data that you are expecting (e.g. unsigned char for anything that won't go over 255). But is it better to just use 'int' anyway because it is the native 32 bit variable? Will it be more efficient using an int over a char (for example, array subscripts, additions and other math, shifts etc)?