This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiler Erro Keil uVision V4.22.22.0

I don't understand this error:

/*---------------------------------------------------------------------------- * This compiling OK, with Num1=22 *--------------------------------------------------------------------------*/
#define Num1 22

unsigned int TempW1;
unsigned int TempW2;

int main (void)
{ TempW1 = Num1; TempW2 = TempW1 - Num1; while(1);
}

Resul--> TempW2=0; it's OK

But

/*---------------------------------------------------------------------------- * This compiling ERROR, with Num1=21+1 *--------------------------------------------------------------------------*/
#define Num1 21+1

unsigned int TempW1;
unsigned int TempW2;

int main (void)
{ TempW1 = Num1; TempW2 = TempW1 - Num1; while(1);
}

Resul--> TempW2=2; it's ERROR

What is happing????

Parents Reply Children
No data