libretro / mupen64plus-libretro-nx

Improved mupen64plus libretro core reimplementation
GNU General Public License v2.0
231 stars 115 forks source link

gcc-14 build failure #546

Open Shoegzer opened 3 months ago

Shoegzer commented 3 months ago

This project builds with gcc-13 but fails with gcc-14. Tested using Linux Mint 22.

custom/dependencies/libzlib/gzlib.c:14:17: error: implicit declaration of function 'lseek'; did you mean 'fseek'? [-Wimplicit-function-declaration]
   14 | #  define LSEEK lseek
      |                 ^~~~~
custom/dependencies/libzlib/gzlib.c:256:24: note: in expansion of macro 'LSEEK'
  256 |         state->start = LSEEK(state->fd, 0, SEEK_CUR);
      |                        ^~~~~
make: *** [Makefile:690: custom/dependencies/libzlib/gzlib.o] Error 1
make: *** Waiting for unfinished jobs....
custom/dependencies/libzlib/gzwrite.c: In function 'gz_comp':
custom/dependencies/libzlib/gzwrite.c:84:15: error: implicit declaration of function 'write'; did you mean 'fwrite'? [-Wimplicit-function-declaration]
   84 |         got = write(state->fd, strm->next_in, strm->avail_in);
      |               ^~~~~
      |               fwrite
custom/dependencies/libzlib/gzwrite.c: In function 'gzclose_w':
custom/dependencies/libzlib/gzwrite.c:573:9: error: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration]
  573 |     if (close(state->fd) == -1)
      |         ^~~~~
      |         pclose
make: *** [Makefile:690: custom/dependencies/libzlib/gzwrite.o] Error 1
custom/dependencies/libzlib/gzread.c: In function 'gz_load':
custom/dependencies/libzlib/gzread.c:30:15: error: implicit declaration of function 'read'; did you mean 'fread'? [-Wimplicit-function-declaration]
   30 |         ret = read(state->fd, buf + *have, len - *have);
      |               ^~~~
      |               fread
custom/dependencies/libzlib/gzread.c: In function 'gzclose_r':
custom/dependencies/libzlib/gzread.c:591:11: error: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration]
  591 |     ret = close(state->fd);
      |           ^~~~~
      |           pclose
make: *** [Makefile:690: custom/dependencies/libzlib/gzread.o] Error 1

@fmahnke hoping you have some ideas here since you fixed gcc-13?

m4xw commented 3 months ago

https://gcc.gnu.org/gcc-14/porting_to.html I guess thats what is going on

gouchi commented 2 months ago

You may try to make some test with this PR.

vanfanel commented 1 month ago

Seeing the same problem here with GCC version 14.2.0 on Debian