I have the following code, for an embedded platform where an int is 16 bits and a long int is 32 bits:
#define MULTIPLIER 0x1000
static void my_function(uint16_t i, void *p)
{
uint32_t start = MULTIPLIER * i;
...
}
My compiler gives me the warning:
Warning 1 : lower precision in wider context: '*'
for this line.
What does this really mean? I can make the warning go away by changing the #define to
#define MULTIPLER 0x1000ul
(explicitly making it an unsigned long) but I would like to understand the warning.