Skip to content

Commit

Permalink
remove fflush() call before exit()
Browse files Browse the repository at this point in the history
the buffer is flushed anyways at exit() and fixes compile error with
gcc14:

    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);
          |                 ~~~~~~~~^~~~~~

this error presents itself when building the libretro core, so this
could be also solved by wrapping the call to fflush():

    #ifndef __LIBRETRO__
    		fflush(stdout);
    #else
                fflush((RFILE *)stdout);
    #endif
  • Loading branch information
ToKe79 authored and irixxxx committed May 25, 2024
1 parent cc1174c commit 8d04801
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion pico/carthw/svp/compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,6 @@ void *ssp_translate_block(int pc)

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

Expand Down

0 comments on commit 8d04801

Please sign in to comment.