Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.85k stars 225 forks source link

MacOS debug build compilation error #681

Closed Macil closed 1 year ago

Macil commented 1 year ago

If you try to make a debug build on MacOS using the command meson build --buildtype=debug && ninja -C build, then this error occurs:

FAILED: vkquake.p/Quake_tasks.c.o
cc -Ivkquake.p -I. -I.. -I/opt/homebrew/include -I/opt/homebrew/include/SDL2 -I/opt/homebrew/opt/mad/include -I/opt/homebrew/Cellar/flac/1.4.2/include -I/opt/homebrew/Cellar/libogg/1.3.5/include -I/opt/homebrew/Cellar/libvorbis/1.3.7/include -I/opt/homebrew/Cellar/opus/1.3.1/include/opus -I/opt/homebrew/Cellar/opusfile/0.12/include/opus -fcolor-diagnostics -include-pch vkquake.p/quakedef.h.pch -Wall -Winvalid-pch -std=gnu11 -O2 -g -D_THREAD_SAFE -Wall -Wno-trigraphs -Wno-unused-function -Werror -DUSE_CODEC_WAVE -DUSE_CODEC_MP3 -DUSE_CODEC_FLAC -DUSE_CODEC_VORBIS -DUSE_CODEC_OPUS -D_DEBUG -MD -MQ vkquake.p/Quake_tasks.c.o -MF vkquake.p/Quake_tasks.c.o.d -o vkquake.p/Quake_tasks.c.o -c ../Quake/tasks.c
../Quake/tasks.c:581:50: error: incompatible function pointer types passing 'void (void **)' to parameter of type 'task_func_t' (aka 'void (*)(void *)') [-Werror,-Wincompatible-function-pointer-types]
                handles[i] = Task_AllocateAssignFuncAndSubmit (LotsOfTasksTestTask, &counters, sizeof (uint32_t *));
                                                               ^~~~~~~~~~~~~~~~~~~
/Users/macil/Coding/quake/vkQuake/build/../Quake/tasks.h:62:75: note: passing argument to parameter 'func' here
static inline task_handle_t Task_AllocateAssignFuncAndSubmit (task_func_t func, void *payload, size_t payload_size)
                                                                          ^
../Quake/tasks.c:578:2: error: variable 'temp_alloc_counters_on_heap' set but not used [-Werror,-Wunused-but-set-variable]
        TEMP_ALLOC_ZEROED (uint32_t, counters, TASKS_MAX_WORKERS);
        ^
/Users/macil/Coding/quake/vkQuake/build/../Quake/mem.h:70:48: note: expanded from macro 'TEMP_ALLOC_ZEROED'
#define TEMP_ALLOC_ZEROED(type, var, size)                        TEMP_ALLOC_TEMPLATE (type, var, size, true, true)
                                                                  ^
/Users/macil/Coding/quake/vkQuake/build/../Quake/mem.h:48:12: note: expanded from macro 'TEMP_ALLOC_TEMPLATE'
        qboolean         temp_alloc_##var##_on_heap = false;                                           \
                         ^
<scratch space>:47:1: note: expanded from here
temp_alloc_counters_on_heap
^
../Quake/tasks.c:605:64: error: incompatible function pointer types passing 'void (int, void **)' to parameter of type 'task_indexed_func_t' (aka 'void (*)(int, void *)') [-Werror,-Wincompatible-function-pointer-types]
        task_handle_t task = Task_AllocateAssignIndexedFuncAndSubmit (IndexedTestTask, LIMIT, &counters, sizeof (uint32_t *));
                                                                      ^~~~~~~~~~~~~~~
/Users/macil/Coding/quake/vkQuake/build/../Quake/tasks.h:70:90: note: passing argument to parameter 'func' here
static inline task_handle_t Task_AllocateAssignIndexedFuncAndSubmit (task_indexed_func_t func, uint32_t limit, void *payload, size_t payload_size)
                                                                                         ^
3 errors generated.
[106/116] Compiling C object vkquake.p/Quake_mem.c.o
ninja: build stopped: subcommand failed.

Desktop:

Macil commented 1 year ago

The commit that introduces this issue is 98e9e1c76e4ea57d6960c8b4c67a72f7f50f45ea.

Novum commented 1 year ago

cf03023