Pros Enum Deprecation Warning in liblvgl - Why?

We are coming up with a [WARNING] while building (making) Pros code in Visual Studio Code. Its just a warning, but I would like to get it cleared up, and suspect Pros Tech Support may need to look into it since the deprecation occurs in one of the Pros libraries.
I see this message whenever I build a program, so I know it isn’t related to the code per se: “/include/liblvgl/core/lv_obj_style.h: In function ‘void lv_obj_remove_style_all(_lv_obj_t*)’:
./include/liblvgl/core/lv_obj_style.h:94:48: warning: bitwise operation between different enumeration types ‘’ and ‘’ is deprecated [-Wdeprecated-enum-enum-conversion]
94 | lv_obj_remove_style(obj, NULL, LV_PART_ANY | LV_STATE_ANY);” Any idea how to get this cleaned up? I am running CLI 3.5.4 and Kernel 4.1.1.

The warning is caused by a function in the graphics library LVGL used to draw to the screen.

The warning is due to two enums of different types being bitwise ORed together. If you edit the function to first cast the two enums to the same type then perform the bitwise OR the warning goes away.

Line 94 in ./include/liblvgl/core/lv_obj_style.h should be:

lv_obj_remove_style(obj, NULL, (lv_style_selector_t)LV_PART_ANY | (lv_style_selector_t)LV_STATE_ANY);

which casts LV_PART_ANY and LV_STATE_ANY first to type lv_style_selector_t then ORs them together.

Github commit with the fix.
LVGL bug report

1 Like

You can also edit the Makefile and add to EXTRA_CXXFLAGS= line so that it equals -Wno-deprecated-enum-enum-conversion (ie have the line be EXTRA_CXXFLAGS=-Wno-deprecated-enum-enum-conversion). This removes the error from appearing when building when enum-enum conversion happens.