lexborisov/Modest

clang11 report error: cast to smaller integer type

Opened this issue · 3 comments

modest/source/mycss/selectors/function_parser.c:469:57: error: cast to smaller integer type 'mycss_selectors_function_drop_type_t' (aka 'enum mycss_selectors_function_drop_type') from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
        mycss_selectors_function_drop_type_t drop_val = mycss_selector_value_drop(selector->value);
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modest/include/mycss/selectors/value.h:28:41: note: expanded from macro 'mycss_selector_value_drop'
#define mycss_selector_value_drop(obj) ((mycss_selectors_function_drop_type_t)(obj))
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[70/138] Building C object CMakeFiles/modest_static.dir/source/mycss/selectors/serialization.c.o
FAILED: CMakeFiles/modest_static.dir/source/mycss/selectors/serialization.c.o 
clang -DMyCORE_BUILD_WITHOUT_THREADS -Imodest/include -O3 -DNDEBUG   -Wall -Werror -pipe -pedantic -Wno-unused-variable -Wno-unused-function -std=gnu99 -MD -MT CMakeFiles/modest_static.dir/source/mycss/selectors/serialization.c.o -MF CMakeFiles/modest_static.dir/source/mycss/selectors/serialization.c.o.d -o CMakeFiles/modest_static.dir/source/mycss/selectors/serialization.c.o   -c modest/source/mycss/selectors/serialization.c
modest/source/mycss/selectors/serialization.c:183:69: error: cast to smaller integer type 'mycss_selectors_function_drop_type_t' (aka 'enum mycss_selectors_function_drop_type') from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]
                    mycss_selectors_function_drop_type_t drop_val = mycss_selector_value_drop(selector->value);
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modest/include/mycss/selectors/value.h:28:41: note: expanded from macro 'mycss_selector_value_drop'
#define mycss_selector_value_drop(obj) ((mycss_selectors_function_drop_type_t)(obj))
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[96/138] Building C object CMakeFiles/modest_static.dir/source/myencoding/encoding.c.o

look at https://github.com/lexbor/lexbor instead, modest is not maintained anymore and is replaced by lexbor

@phpstatic have you been able to fix the issue?

Probably you are trying to build it on osx?