allusive-dev / compfy

A Compositor for X11 based on Picom. No Longer Maintained in favor of Picom v12!
198 stars 24 forks source link

Build errors with llvm 17 and musl #13

Closed theoparis closed 1 year ago

theoparis commented 1 year ago
../src/options.c:188:57: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    {"animation-open-exclude", required_argument, NULL, 814, "animation open exclude list"},
                                                        ^~~
../src/options.c:189:52: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
    {"animation-unmap-exclude", required_argument, NULL, 815, "animation unmap exclude list"},
                                                   ^~~~
/usr/include/stddef.h:9:14: note: expanded from macro 'NULL'
#define NULL ((void*)0)
             ^~~~~~~~~~
../src/options.c:189:58: error: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
    {"animation-unmap-exclude", required_argument, NULL, 815, "animation unmap exclude list"},
                                                         ^~~
../src/options.c:787:9: error: call to undeclared function 'parse_rule_corners'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                        if (!parse_rule_corners(&opt->corner_rules, optarg))
                             ^
9 errors generated.
[28/31] Compiling C object src/picom.p/win.c.o
FAILED: src/picom.p/win.c.o
ccache cc -Isrc/picom.p -Isrc -I../src -Isubprojects/test.h -I../subprojects/test.h -I/usr/include/pixman-1 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -std=c11 -O0 -g '-DPICOM_VERSION="vgit-5c118"' -D_GNU_SOURCE -DHAS_STDC_PREDEF_H -DCONFIG_LIBCONFIG -DCONFIG_REGEX_PCRE -DCONFIG_REGEX_PCRE_JIT -DCONFIG_OPENGL -DGL_GLEXT_PROTOTYPES -DCONFIG_DBUS -DHAS_INOTIFY -MD -MQ src/picom.p/win.c.o -MF src/picom.p/win.c.o.d -o src/picom.p/win.c.o -c ../src/win.c
../src/win.c:1465:20: error: incompatible pointer to integer conversion assigning to 'int' from 'void *' [-Wint-conversion]
                w->corner_radius = val;
allusive-dev commented 1 year ago

Two questions.

  1. What is llvm 17 and musl
  2. What version are you trying to build.
theoparis commented 1 year ago

LLVM is the compiler project that provides clang/clang++ as alternative to gcc/g++. Musl is like glibc, it is a libc for linux. I tried both 1.1.0 and the latest commit from the main branch.

It seems like it is a minor fix. I defined parse_rule_corners in config.h and not just config.c, and for now I disabled warnings to hide the -Wint-conversion error although that is not a good idea. It did fix the issue though.

allusive-dev commented 1 year ago

LLVM is the compiler project that provides clang/clang++ as alternative to gcc/g++. Musl is like glibc, it is a libc for linux. I tried both 1.1.0 and the latest commit from the main branch.

I guess you learn something everyday, haha.

I'll add that line to config.h now. Thanks