Skip to content

Commit

Permalink
Fix compiler warning that occurs with link-time optimization
Browse files Browse the repository at this point in the history
With LTO enable, the build fails with:

 [100%] Linking C executable hatari
 .../src/cpu/savestate.h:281:14: error: type of 'savestate_fname' does not
  match original declaration [-Werror=lto-type-mismatch]
   281 | extern TCHAR savestate_fname[MAX_DPATH];
       |              ^
 .../src/cpu/custom.c:40:8: note:
  'savestate_fname' was previously declared here
    40 | TCHAR *savestate_fname;
       |        ^
 lto1: all warnings being treated as errors

Declare the array according to the definition in the header file to fix it.
  • Loading branch information
huth committed Dec 21, 2023
1 parent ebcb692 commit adccd68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cpu/custom.c
Expand Up @@ -37,7 +37,7 @@ extern struct regstruct mmu_backup_regs;
evt_t currcycle;
/* declared in savestate.h */
int savestate_state = 0;
TCHAR *savestate_fname;
TCHAR savestate_fname[MAX_DPATH];
/* declared in custom.h */
uae_u32 hsync_counter = 0, vsync_counter = 0;
#endif
Expand Down

0 comments on commit adccd68

Please sign in to comment.