matlo / GIMX

The GIMX software.
GNU General Public License v3.0
590 stars 105 forks source link

Add missing headers reported by `gcc-13`, fix `adapter_detect()` prototype consistency #705

Open trofi opened 9 months ago

trofi commented 9 months ago

Two simple changes for gcc-13 compatibility:

Add missing headers reported by gcc-13 controller.c: fix adapter_detect() prototype consistency

fabrecordz commented 7 months ago

@trofi Hey man, are you able to compile on Win? the Inno is not creating the setup for me

make[2]: Entering directory '/d/GIMX test/GIMX-build/windows/GIMX/shared/gimxcontroller' cc -fPIC -Iinclude -Wall -Wextra -Werror -O3 -D__USE_MINGW_ANSI_STDIO=0 -I../ -DGLOG_NAME=gimxcontroller -c -o src/controller.o src/controller.c src/controller.c: In function 'controller_get_axis_index': src/controller.c:361:10: error: the comparison will always evaluate as 'true' for the address of 'name' will never be NULL [-Werror=address] 361 | if(controllers[C_TYPE_SIXAXIS]->axes[i].name) | ^~~ In file included from src/controller.c:6: src/../include/controller.h:46:14: note: 'name' declared here 46 | const char name[AXIS_NAME_MAX_SIZE]; | ^~~~ cc1.exe: all warnings being treated as errors make[2]: [: src/controller.o] Error 1 make[2]: Leaving directory '/d/GIMX test/GIMX-build/windows/GIMX/shared/gimxcontroller' make[1]: [Makefile:35: build-gimxcontroller] Error 2 make[1]: Leaving directory '/d/GIMX test/GIMX-build/windows/GIMX/shared' make: *** [Makefile:15: build-shared] Error 2 make: Leaving directory '/d/GIMX test/GIMX-build/windows/GIMX'

trofi commented 7 months ago

I did not try windows but on linux we have to workaround a similar error.

It is caused by use of blanket -Werror in Makedefs files in a few places. Try removing the -Werror from there.

In nixpkgs we pass extra compiler flags to workaround it as: -Wno-error=address -Wno-error=deprecated-declarations -Wno-error=use-after-free

fabrecordz commented 7 months ago

Any chance you can send me the updated one? I want to compile the win version. Linux worked just fine. It's been 5 days straight and I'm unable to compile it in Windows (tried adding missing headers, removing -Werror- and much more, but I keep digging a hole.

Eclipes IDE Mingw64 and GCC 13.xx Downloaded all the missing libraries (SDL, CURL and others).

Any guidance really would be appreciated.

fabrecordz commented 7 months ago

@trofi I also have countless missing headers. I added them to the Path, and got a lot of them resolved. Did you had to point to the include folders and such?

Thanks

trofi commented 7 months ago

No, this PR (and disabled warnings) is all I needed to get it to build.