Description
Compilation error with undefined return value in Dev 6.1
What MCU/Processor/Board and compiler are you using?
Keil uVision MDK 5.27 with ARMCC V5.06 update 6 toolchain.
What do you experience?
Build fails with undefined identifier for LV_LABEL_TEXT_SEL_OFF.
compiling lv_label.c...
..\..\lvgl\src\lv_objx\lv_label.c(730): error: #20: identifier "LV_LABEL_TEXT_SEL_OFF" is undefined
return LV_LABEL_TEXT_SEL_OFF;
..\..\lvgl\src\lv_objx\lv_label.c(748): error: #20: identifier "LV_LABEL_TEXT_SEL_OFF" is undefined
return LV_LABEL_TEXT_SEL_OFF;
..\..\lvgl\src\lv_objx\lv_label.c: 0 warnings, 2 errors
Two functions:
uint16_t lv_label_get_text_sel_start(const lv_obj_t * label)
uint16_t lv_label_get_text_sel_end(const lv_obj_t * label)
Both return LV_LABEL_TEXT_SEL_OFF when LV_LABEL_TEXT_SEL = 0
#if LV_LABEL_TEXT_SEL
.
.
.
#else
(void)label; /*Unused*/
return LV_LABEL_TEXT_SEL_OFF;
#endif
What do you expect?
Definition of LV_LABEL_TEXT_SEL_OFF should be in lv_label.h
#define LV_LABEL_TEXT_SEL_OFF 0xFFFF
Code to reproduce
Define text select to 0 and build.
#define LV_LABEL_TEXT_SEL 0