build on Linux: mismatched bound float[4]
I'm sure I'm doing something silly and rookie-ish so I apologize in advance.
I'm on Arch Linux, I've typed the git clone command as per the readme, cd minecraft-weekend and make
and I receive the following error while trying to make cglm:
(I've shortened the paths below, sorry the new lines and spacing is kinda gone)
..minecraft-weekend/lib/cglm/src/vec4.c:127:25: error: argument 1 of type 'float[4]' with mismatched bound [-Werror=array-parameter=]
127 | glmc_vec4_scale_as(vec4 v, float s, vec4 dest) {
| ~~~~~^
In file included from ../minecraft-weekend/lib/cglm/src/../include/cglm/call.h:17,
from ../minecraft-weekend/lib/cglm/src/vec4.c:9:
../minecraft-weekend/lib/cglm/src/../include/cglm/call/vec4.h:102:25: note: previously declared as 'float[3]'
102 | glmc_vec4_scale_as(vec3 v, float s, vec3 dest);
| ~~~~~^
../minecraft-weekend/lib/cglm/src/vec4.c:127:42: error: argument 3 of type 'float[4]' with mismatched bound [-Werror=array-parameter=]
127 | glmc_vec4_scale_as(vec4 v, float s, vec4 dest) {
| ~~~~~^~~~
In file included from ../minecraft-weekend/lib/cglm/src/../include/cglm/call.h:17,
from ../minecraft-weekend/lib/cglm/src/vec4.c:9:
../minecraft-weekend/lib/cglm/src/../include/cglm/call/vec4.h:102:42: note: previously declared as 'float[3]'
102 | glmc_vec4_scale_as(vec3 v, float s, vec3 dest);
| ~~~~~^~~~
cc1: all warnings being treated as errors
To help anybody else who comes across this, simply update the libs/cglm submodule to the v0.8.4 tag and it should build fine.
go to minecraft-weekend/lib/cglm/include/cglm/call/vec4.h in line 102, and change
glmc_vec4_scale_as(vec3 v, float s, vec3 dest);
to
glmc_vec4_scale_as(vec4 v, float s, vec4 dest);