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\'
For any typedef you can get arrount this by changing to
#define FLASH_BLOCK_SIZE ((uint8_t)+64)
notice the little plus in there?
The preprocessor replaces the typename it doesn't know anything about by 0, so this works out in both contexts. (The preprocessor is supposed to do all arithmetic in [u]intmax_t
, anyhow)
For the actual type you are using all of this makes not much sense. There is no such thing as a uint8_t
constant. As soon they are evaluated all expressions of a type that is narrower than int
are converted to int
. So it probably doesn't makes any difference.