The following code generates a compiler error (and shouldn't):
#include <stdio.h>
#define BITMASK 54
int main(int argc, char** argv)
{
unsigned short num;
num = (0xff-BITMASK);
printf("The number is %d\n", num);
return 0;
}
Below is a workaround:
#include <stdio.h>
#define BITMASK 54
int main(int argc, char** argv)
{
unsigned short num;
num = (0xff - BITMASK);
printf("The number is %d\n", num);
return 0;
}
The only difference between the two code samples is the addition of whitespace between the hex constant and the BITMASK constant. This appears to be a problem in earlier versions of the compiler as well as 2.90.5.