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

#if (x>0) conditional compilation does not work

Hello, I'm using KEIL V5.10 with STM32F103.
My project has some enum type variables, such as
typedef enum
{ a0 = 0, a1, a2, an
} aType;

In source file, I used conditional compile statements:

#if (an > 0) xxxx
#endif

But the body inside was not compiled whatever an is higher than zero, I don't know why.

An array can be correctly complied if I used an as array's length, such as

static uint16_t u16Buf[an];

There is no warning or error after compilation.

Anyone knows why the conditional compilation does not work?

Thanks!