In a microcontroller code, I am using a library provided by the producer where there are many constants defined. I\'m trying to give an error if there\'
I know the issue thread is old, however I encountered it today... If you do not want to or cannot change the #define, the other answers are great, but if you have access to the #define, I recommend using for pre-processor operations (#if - #else - #endif) instead of:
#define FLASH_BLOCK_SIZE ((uint8_t)64)
use this define:
#define FLASH_BLOCK_SIZE (64U)
This way the cast is still there, and the compiler won't be "confused".