libretro / picodrive

Fast MegaDrive/MegaCD/32X emulator
Other
38 stars 60 forks source link

picodrive fails to compile with gcc-14.1 on arm32 #227

Closed heitbaum closed 3 weeks ago

heitbaum commented 1 month ago

Compile on arm32 with gcc-14.1 fails with the below error. on aarch64 and x86_64 the compile does not error.

pico/carthw/svp/compiler.c: In function 'ssp_translate_block':
pico/carthw/svp/compiler.c:1800:24: error: passing argument 1 of 'rfflush' from incompatible pointer type [-Wincompatible-pointer-types]
 1800 |                 fflush(stdout);
      |                        ^~~~~~
      |                        |
      |                        FILE *
In file included from ./pico/pico_port.h:12,
                 from ./pico/pico_int.h:15,
                 from pico/carthw/svp/compiler.c:9:
platform/libretro/libretro-common/include/streams/file_stream_transforms.h:89:25: note: expected 'RFILE *' but argument is of type 'FILE *'
   89 | int64_t rfflush(RFILE * stream);
      |                 ~~~~~~~~^~~~~~

a workaround patch of the below allows the compile to complete

--- a/pico/carthw/svp/compiler.c        2024-05-23 07:19:59.237513012 +0000
+++ b/pico/carthw/svp/compiler.c        2024-05-23 07:19:48.767443545 +0000
@@ -1797,7 +1797,7 @@

        if (tcache_ptr - (u32 *)tcache > DRC_TCACHE_SIZE/4) {
                elprintf(EL_ANOMALY|EL_STATUS|EL_SVP, "tcache overflow!\n");
-               fflush(stdout);
+               fflush((RFILE *)stdout);
                exit(1);
        }
irixxxx commented 1 month ago

fixed with 8d04801 in my repo. In with the next merge.

irixxxx commented 3 weeks ago

merged