the compiler does not generate an overflow error constants.
$cat bug5.c
#include <pic16f877a.h>
#include <stdint.h>
#define DIV_idelay ((uint16_t)4*16*256)
#define delay_mstoi(time) ((((int32_t)(F_CPU))*(time)+((int32_t)1000*DIV_idelay/2))/ ((int32_t)1000*DIV_idelay))
uint8_t tmp8;
uint16_t tmp16;
void main(void) {
//error 158: overflow in implicit constant conversion
tmp8=delay_mstoi(3000);
tmp16=delay_mstoi(3000);
}
$ sdcc --Werror -pp16f877a --opt-code-size -Ilibmain -DF_CPU=4000000 -mpic14 --use-non-free bug5.c
message: using default linker script "/usr/local/share/gputils/lkr/16f877a_g.lkr"
$ sdcc -v
SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.0 #8008 (Jul 6 2012) (Linux)
Diff: