Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang 12: error: cast to smaller integer type 'mycss_selectors_function_drop_type_t' #26

Closed
badBlackShark opened this issue Jun 6, 2021 · 6 comments

Comments

@badBlackShark
Copy link

badBlackShark commented Jun 6, 2021

Whenever I try to include this as a dependency for a new project the postinstall fails. When I try to make it manually, it fails with the same error. This wasn't the case in previous versions.

Here's the full error:

(base) Fishbowl:myhtml shark$ make
cd src/ext && make package
git clone https://github.com/lexborisov/Modest.git ./modest-c
Cloning into './modest-c'...
remote: Enumerating objects: 4945, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 4945 (delta 11), reused 15 (delta 6), pack-reused 4911
Receiving objects: 100% (4945/4945), 6.44 MiB | 25.38 MiB/s, done.
Resolving deltas: 100% (3556/3556), done.
cd modest-c && git reset --hard 393338d994c921705ff71dfbd1d98ceb31328f14
HEAD is now at 393338d Update includes.
cd modest-c && make static MyHTML_BUILD_SHARED=OFF MyCORE_BUILD_WITHOUT_THREADS=YES PROJECT_OPTIMIZATION_LEVEL=-O3 -j
sed -e 's,@version\@,0.0.6,g' -e 's,@prefix\@,/usr/local,g' -e 's,@exec_prefix\@,/usr/local,g' -e 's,@libdir\@,lib,g' -e 's,@includedir\@,include,g' -e 's,@cflags\@,-I$\{includedir}/modest -I$\{includedir}/mycore -I$\{includedir}/mycss -I$\{includedir}/myencoding -I$\{includedir}/myfont -I$\{includedir}/myhtml -I$\{includedir}/myunicode -I$\{includedir}/myurl,g' -e 's,@libname\@,modest,g' -e 's,@description\@,fast HTML renderer library with no outside dependency,g' modest.pc.in >  modest.pc
mkdir -p bin lib test_suite

cc -Wall -Werror -pipe -pedantic -Isource -DMyCORE_BUILD_WITHOUT_THREADS -fPIC -O3 -Wno-unused-variable -Wno-unused-function -std=c99 -DMODEST_BUILD_OS=Darwin -DMODEST_PORT_NAME=posix -DMyCORE_OS_DARWIN   -c -o ssource/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);
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/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.
ource/myhtml/./tokenizer_end.o source/myhtml/./tokenizer_end.c
make[2]: *** [source/mycss/selectors/serialization.o] Error 1
make[2]: *** Waiting for unfinished jobs....
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);
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/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.
make[2]: *** [source/mycss/selectors/function_parser.o] Error 1
make[1]: *** [modest-c/lib/libmodest_static.a] Error 2
make: *** [src/ext/myhtml-c/lib/libmodest_static.a] Error 2
@kostya
Copy link
Owner

kostya commented Jun 6, 2021

what os? gcc versions? what previous version compiled for you?

@badBlackShark
Copy link
Author

OS: macOS Big Sur (11.4)
gcc: gcc -vgives Apple clang version 12.0.5
Last working version: Whatever was the one right before 1.0. I think it was 0.36.1?

@kostya
Copy link
Owner

kostya commented Jun 6, 2021

This is not related to crystal. C extension cannot compile with your clang. This looks like Modest issue, you failed here: git clone https://github.com/lexborisov/Modest.git && cd Modest && make (lexborisov/Modest#82)

@kostya
Copy link
Owner

kostya commented Jun 6, 2021

They suggest to move to lexbor, there is already binding for it: https://github.com/kostya/lexbor, but still missing css selectors.

@kostya kostya changed the title Make doesn't work with Crystal 1.0 Clang 12: error: cast to smaller integer type 'mycss_selectors_function_drop_type_t' Jun 6, 2021
@badBlackShark
Copy link
Author

They suggest to move to lexbor, there is already binding for it: https://github.com/kostya/lexbor, but still missing css selectors.

Fair enough, that is what I'm doing for now. I don't need css selectors as of yet, so I should be good to go!

@kostya
Copy link
Owner

kostya commented Mar 13, 2022

lexbor support selectors already, also there is branch clang13 in myhtml, just for compile on apple m1, but it is probably unsafe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants