#2152 no report "error 158: overflow in implicit constant conversion"

open
nobody
None
PIC14
5
2013-05-25
2013-04-03
No

the compiler does not generate an overflow error constants.

$cat bug5.c

include <pic16f877a.h>

include <stdint.h>

define DIV_idelay ((uint16_t)416256)

define delay_mstoi(time) ((((int32_t)(F_CPU))(time)+((int32_t)1000DIV_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)

1 Attachments

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks