Warnings: Difference between revisions

From vice-emu
Jump to navigation Jump to search
(48 intermediate revisions by 3 users not shown)
Line 3: Line 3:
== GCC ==
== GCC ==


* Strobe, MSYS2 x64 Gtk3, r38482


* gpz (x86, Linux/Gentoo, 64bit, GCC 6.4.0, GTK3) (3.2 tarball)
<pre>
magicvoice.c: In function 'magicvoice_mmu_translate':
magicvoice.c:1269:27: warning: array subscript -49152 is outside array bounds of 'uint8_t[16384]' {aka 'unsigned char[16384]'} [-Warray-bounds]
1269 |                    *base = (uint8_t *)(mv_rom - (uint8_t *)0xc000);
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
magicvoice.c:132:16: note: while referencing 'mv_rom'
  132 | static uint8_t mv_rom[MV_ROM_SIZE];
      |                ^~~~~~
magicvoice.c:1289:27: warning: array subscript -40960 is outside array bounds of 'uint8_t[16384]' {aka 'unsigned char[16384]'} [-Warray-bounds]
1289 |                    *base = (uint8_t *)(mv_rom - (uint8_t *)0xa000);
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
magicvoice.c:132:16: note: while referencing 'mv_rom'
  132 | static uint8_t mv_rom[MV_ROM_SIZE];
      |                ^~~~~~


./configure --program-prefix=gtk3- --enable-debug --enable-native-gtk3ui --enable-debug-gtk3ui --enable-native-tools --enable-arch=native --prefix=/usr/games/ --enable-parsid --with-midas --with-resid --with-xaw3d --with-arts --with-x --enable-ethernet --with-pulse --with-sdlsound --enable-fullscreen --enable-cpuhistory --enable-static-ffmpeg --enable-static-lame
....


no warnings besides a bunch of ffmpeg related things that are not listed here (we dont fix them)
vsidmem.c: In function 'mem_initialize_memory':
vsidmem.c:532:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  532 |        mem_read_base_tab[1][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:533:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  533 |        mem_read_base_tab[2][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:534:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  534 |        mem_read_base_tab[3][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:535:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  535 |        mem_read_base_tab[9][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:536:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  536 |        mem_read_base_tab[10][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:537:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  537 |        mem_read_base_tab[11][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:538:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  538 |        mem_read_base_tab[25][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:539:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  539 |        mem_read_base_tab[26][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
vsidmem.c:540:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  540 |        mem_read_base_tab[27][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
  81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~


....


* compyx (x64, Windows 10/msys2, GCC 7.3.0, SDL2) (r35061)
c64mem.c: In function 'mem_initialize_memory':
:: Quite a few warnings after updating msys64, resulting in upgrading GCC from 7.3.0 to 8.2.0, though we can probably ignore the warnings about VTE.
c64mem.c:769:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  769 |        mem_read_base_tab[1][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64mem.c:770:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  770 |        mem_read_base_tab[2][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64mem.c:771:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  771 |        mem_read_base_tab[3][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64mem.c:772:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  772 |        mem_read_base_tab[9][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64mem.c:773:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  773 |        mem_read_base_tab[10][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64mem.c:774:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  774 |        mem_read_base_tab[11][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64mem.c:775:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  775 |        mem_read_base_tab[26][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64mem.c:776:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  776 |        mem_read_base_tab[27][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
  87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~


<pre>
....
In file included from ../../../../vice/src/arch/sdl/archdep.c:54:0:
 
../../../../vice/src/arch/sdl/archdep_win32.c: In function 'kbd_arch_get_host_mapping':
c64memsc.c: In function 'mem_initialize_memory':
../../../../vice/src/arch/sdl/archdep_win32.c:781:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
c64memsc.c:718:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
    int lang = (int)GetKeyboardLayout(0);
  718 |        mem_read_base_tab[1][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
                ^
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
../../../../vice/src/arch/sdl/archdep_win32.c:224:13: warning: 'system_wcstombs_free' defined but not used [-Wunused-function]
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
static void system_wcstombs_free(char *mbs)
      |        ^~~~~~~~~~~~~~~
            ^22:48, 18 June 2018 (CEST)22:48, 18 June 2018 (CEST)22:48, 18 June 2018 (CEST)[[User:Compyx|Compyx]] ([[User talk:Compyx|talk]]) 22:48, 18 June 2018 (CEST)
c64memsc.c:719:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
../../../../vice/src/arch/sdl/archdep_win32.c:210:14: warning: 'system_wcstombs_alloc' defined but not used [-Wunused-function]
  719 |        mem_read_base_tab[2][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
static char *system_wcstombs_alloc(const char *wcs)
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              ^22:48, 18 June 2018 (CEST)22:48, 18 June 2018 (CEST)22:48, 18 June 2018 (CEST)22:48, 18 June 2018 (CEST)
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
../../../../vice/src/arch/sdl/menu_c64cart.c: In function 'makegroup':
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
../../../../vice/src/arch/sdl/menu_c64cart.c:87:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      |         ^~~~~~~~~~~~~~~
            ui_c64cart_entry.data = (ui_callback_data_t)(unsigned long)cartlist->crtid;
c64memsc.c:720:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
                                    ^
  720 |        mem_read_base_tab[3][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
In file included from ../../../../vice/src/arch/sdl/menu_midi.c:35:0:
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../vice/src/arch/sdl/menu_midi.c:161:18: warning: no previous prototype for 'MIDIInDev_dynmenu_callback' [-Wmissing-prototypes]
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
UI_MENU_CALLBACK(MIDIInDev_dynmenu_callback)
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
                  ^
      |        ^~~~~~~~~~~~~~~
../../../../vice/src/arch/sdl/menu_common.h:62:17: note: in definition of macro 'UI_MENU_CALLBACK'
c64memsc.c:721:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
    const char *name(int activated, ui_callback_data_t param)
  721 |        mem_read_base_tab[9][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
                ^[[User:Compyx|Compyx]] ([[User talk:Compyx|talk]])
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../vice/src/arch/sdl/menu_midi.c: In function 'MIDIInDev_dynmenu_callback':
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
../../../../vice/src/arch/sdl/menu_midi.c:189:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
                midi_in_dyn_menu[i].data = (ui_callback_data_t)j;
      |        ^~~~~~~~~~~~~~~
                                            ^
c64memsc.c:722:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
In file included from ../../../../vice/src/arch/sdl/menu_midi.c:35:0:
  722 |        mem_read_base_tab[10][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
../../../../vice/src/arch/sdl/menu_midi.c: At top level:
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../vice/src/arch/sdl/menu_midi.c:203:18: warning: no previous prototype for 'MIDIOutDev_dynmenu_callback' [-Wmissing-prototypes]
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
UI_MENU_CALLBACK(MIDIOutDev_dynmenu_callback)
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
                  ^
      |        ^~~~~~~~~~~~~~~
../../../../vice/src/arch/sdl/menu_common.h:62:17: note: in definition of macro 'UI_MENU_CALLBACK'
c64memsc.c:723:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
    const char *name(int activated, ui_callback_data_t param)
  723 |        mem_read_base_tab[11][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
                ^[[User:Compyx|Compyx]] ([[User talk:Compyx|talk]])
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../vice/src/arch/sdl/menu_midi.c: In function 'MIDIOutDev_dynmenu_callback':
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
../../../../vice/src/arch/sdl/menu_midi.c:231:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
                midi_out_dyn_menu[i].data = (ui_callback_data_t)j;
      |        ^~~~~~~~~~~~~~~
                                            ^
c64memsc.c:724:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
../../../../vice/src/arch/sdl/menu_settings.c: In function 'uikeyboard_menu_create':
  724 |        mem_read_base_tab[26][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
../../../../vice/src/arch/sdl/menu_settings.c:179:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ui_keyboard_mapping_entry.data = (ui_callback_data_t)(unsigned long)kbdlist->mapping;
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
                                        ^
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
c64memsc.c:725:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  725 |        mem_read_base_tab[27][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
  90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |        ^~~~~~~~~~~~~~~
</pre>
</pre>
 
NOTE remaining warnings are expected as Compyx describes below
 
* compyx (x64, Windows 10/msys2, GCC 8.2.0, Gtk3) (r35433)
 
<pre>
<pre>
Making all in hwsiddrv
c64dtvcpu.c:537:2: warning: #warning "CPUMEMHISTORY implementation for x64dtv is incomplete" [-Wcpp]
../../../vice/src/hwsiddrv/ps-win32-dll.c: In function 'parsid_GetAddressLptPortInTheRegistry':
  537 | #warning "CPUMEMHISTORY implementation for x64dtv is incomplete"
../../../vice/src/hwsiddrv/ps-win32-dll.c:243:26: warning: '%d' directive writing 1 byte into a region of size between 0 and 254 [-Wformat-overflow=]
      |  ^~~~~~~
    sprintf(myData, "%s\\%d", myKey, myPort - 1);
                          ^~
../../../vice/src/hwsiddrv/ps-win32-dll.c:243:21: note: directive argument in the range [0, 2]
    sprintf(myData, "%s\\%d", myKey, myPort - 1);
                    ^~~~~~~~
../../../vice/src/hwsiddrv/ps-win32-dll.c:243:5: note: 'sprintf' output between 3 and 257 bytes into a destination of size 255
    sprintf(myData, "%s\\%d", myKey, myPort - 1);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../vice/src/hwsiddrv/ps-win32-io.c: In function 'parsid_GetAddressLptPortInTheRegistry':
../../../vice/src/hwsiddrv/ps-win32-io.c:207:26: warning: '%d' directive writing 1 byte into a region of size between 0 and 254 [-Wformat-overflow=]
    sprintf(myData, "%s\\%d", myKey, myPort - 1);
                          ^~
../../../vice/src/hwsiddrv/ps-win32-io.c:207:21: note: directive argument in the range [0, 2]
    sprintf(myData, "%s\\%d", myKey, myPort - 1);
                    ^~~~~~~~
../../../vice/src/hwsiddrv/ps-win32-io.c:207:5: note: 'sprintf' output between 3 and 257 bytes into a destination of size 255
    sprintf(myData, "%s\\%d", myKey, myPort - 1);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


c128cpu.c:123:2: warning: #warning "CPUMEMHISTORY implementation for x128 is incomplete" [-Wcpp]
  123 | #warning "CPUMEMHISTORY implementation for x128 is incomplete"
      |  ^~~~~~~


petcpu.c:69:2: warning: #warning "CPUMEMHISTORY implementation for xpet is incomplete" [-Wcpp]
  69 | #warning "CPUMEMHISTORY implementation for xpet is incomplete"
      |  ^~~~~~~


Making all in cart
plus4cpu.c:40:2: warning: #warning "CPUMEMHISTORY implementation for xplus4 is incomplete" [-Wcpp]
../../../../vice/src/c64/cart/crt.c: In function 'crt_open':
  40 | #warning "CPUMEMHISTORY implementation for xplus4 is incomplete"
../../../../vice/src/c64/cart/crt.c:160:9: warning: 'strncpy' output may be truncated copying 32 bytes from a string of length 63 [-Wstringop-truncation]
      |  ^~~~~~~
        strncpy(header->name, (char*)&crt_header[0x20], sizeof(header->name) - 1);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../vice/src/c64/cart/crt.c: In function 'crt_create':
../../../../vice/src/c64/cart/crt.c:289:5: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
    strncpy((char*)&crt_header[0x20], name, sizeof(crt_header) - 0x20);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Making all in scpu64
In file included from ../../../vice/src/scpu64/../main65816cpu.c:341,
                from ../../../vice/src/scpu64/scpu64cpu.c:431:
../../../vice/src/scpu64/../main65816cpu.c: In function 'maincpu_mainloop':
../../../vice/src/scpu64/../65816core.c:3648:39: warning: 'p3' may be used uninitialized in this function [-Wmaybe-uninitialized]
            uint8_t bk = (uint8_t)(p3 >> 16);
                                  ~~~~^~~~~~
../../../vice/src/scpu64/../65816core.c:2554:34: note: 'p3' was declared here
        unsigned int p0, p1, p2, p3;
                                  ^~
../../../vice/src/scpu64/../65816core.c:3647:39: warning: 'p2' may be used uninitialized in this function [-Wmaybe-uninitialized]
            uint8_t hi = (uint8_t)(p2 >> 8);
                                  ~~~~^~~~~
../../../vice/src/scpu64/../65816core.c:2554:30: note: 'p2' was declared here
        unsigned int p0, p1, p2, p3;
                              ^~
../../../vice/src/scpu64/../65816core.c:3650:13: warning: 'p1' may be used uninitialized in this function [-Wmaybe-uninitialized]
            debug_main65816cpu((uint32_t)(debug_pc), debug_clk,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          mon_disassemble_to_string(e_comp_space,
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                    debug_pc, op,
                                                    ~~~~~~~~~~~~~
                                                    lo, hi, bk, 1, "65816"),
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~
                          debug_c, debug_x, debug_y, debug_sp, debug_pbr);
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../vice/src/scpu64/../65816core.c:2554:26: note: 'p1' was declared here
        unsigned int p0, p1, p2, p3;
                          ^~


 
cbm2cpu.c:68:2: warning: #warning "CPUMEMHISTORY implementation for xcbm2 is incomplete" [-Wcpp]
 
   68 | #warning "CPUMEMHISTORY implementation for xcbm2 is incomplete"
Making all in novte
      |  ^~~~~~~
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:100,
                from ../../../../../vice/src/arch/gtk3/novte/keymap.cc:26:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:271,
                from ../../../../../vice/src/arch/gtk3/novte/keymap.cc:26:
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:100,
                from ../../../../../vice/src/arch/gtk3/novte/vteterminal.h:25,
                from ../../../../../vice/src/arch/gtk3/novte/novte.h:28,
                from ../../../../../vice/src/arch/gtk3/novte/ring.h:27,
                from ../../../../../vice/src/arch/gtk3/novte/ring.cc:24:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:271,
                from ../../../../../vice/src/arch/gtk3/novte/vteterminal.h:25,
                from ../../../../../vice/src/arch/gtk3/novte/novte.h:28,
                from ../../../../../vice/src/arch/gtk3/novte/ring.h:27,
                from ../../../../../vice/src/arch/gtk3/novte/ring.cc:24:
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:100,
                from ../../../../../vice/src/arch/gtk3/novte/vteterminal.h:25,
                from ../../../../../vice/src/arch/gtk3/novte/novte.h:28,
                from ../../../../../vice/src/arch/gtk3/novte/vte.cc:35:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:271,
                from ../../../../../vice/src/arch/gtk3/novte/vteterminal.h:25,
                from ../../../../../vice/src/arch/gtk3/novte/novte.h:28,
                from ../../../../../vice/src/arch/gtk3/novte/vte.cc:35:
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:100,
                from ../../../../../vice/src/arch/gtk3/novte/vteaccess.cc:32:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:271,
                from ../../../../../vice/src/arch/gtk3/novte/vteaccess.cc:32:
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:100,
                from ../../../../../vice/src/arch/gtk3/novte/vtedraw.cc:33:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:271,
                from ../../../../../vice/src/arch/gtk3/novte/vtedraw.cc:33:
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:100,
                from ../../../../../vice/src/arch/gtk3/novte/vtegtk.cc:44:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:271,
                from ../../../../../vice/src/arch/gtk3/novte/vtegtk.cc:44:
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:100,
                from ../../../../../vice/src/arch/gtk3/novte/vteterminal.h:25,
                from ../../../../../vice/src/arch/gtk3/novte/novte.h:28,
                from ../../../../../vice/src/arch/gtk3/novte/vteseq.cc:33:
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
   void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
In file included from C:/msys64/mingw64/include/gtk-3.0/gtk/gtk.h:271,
                from ../../../../../vice/src/arch/gtk3/novte/vteterminal.h:25,
                from ../../../../../vice/src/arch/gtk3/novte/novte.h:28,
                from ../../../../../vice/src/arch/gtk3/novte/vteseq.cc:33:
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: warning: unnecessary parentheses in declaration of '__gtk_reserved1' [-Wparentheses]
  void (*__gtk_reserved1);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: warning: unnecessary parentheses in declaration of '__gtk_reserved2' [-Wparentheses]
  void (*__gtk_reserved2);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: warning: unnecessary parentheses in declaration of '__gtk_reserved3' [-Wparentheses]
  void (*__gtk_reserved3);
        ^
C:/msys64/mingw64/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: warning: unnecessary parentheses in declaration of '__gtk_reserved4' [-Wparentheses]
  void (*__gtk_reserved4);
        ^
 
 
 
../../../../vice/src/arch/gtk3/uinetplay.c: In function 'netplay_update_resources':
../../../../vice/src/arch/gtk3/uinetplay.c:119:5: warning: 'strncpy' specified bound 256 equals destination size [-Wstringop-truncation]
    strncpy(p, gtk_entry_get_text(GTK_ENTRY(np_port)), 256);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
 
Making all in hvsc
../../vice/src/debug.c: In function 'debug_maincpu':
../../vice/src/debug.c:453:46: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
        int line_len = sprintf(tempstr, "%s\n", st);
                                              ^
../../vice/src/debug.c:453:24: note: 'sprintf' output between 2 and 129 bytes into a destination of size 128
        int line_len = sprintf(tempstr, "%s\n", st);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../vice/src/debug.c: In function 'debug_main65816cpu':
../../vice/src/debug.c:453:46: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
        int line_len = sprintf(tempstr, "%s\n", st);
                                              ^
../../vice/src/debug.c:453:24: note: 'sprintf' output between 2 and 129 bytes into a destination of size 128
        int line_len = sprintf(tempstr, "%s\n", st);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../vice/src/debug.c: In function 'debug_drive':
../../vice/src/debug.c:453:46: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
        int line_len = sprintf(tempstr, "%s\n", st);
                                              ^
../../vice/src/debug.c:453:24: note: 'sprintf' output between 2 and 129 bytes into a destination of size 128
        int line_len = sprintf(tempstr, "%s\n", st);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../vice/src/util.c: In function 'util_add_extension_maxpath':
../../vice/src/util.c:1431:5: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
    sprintf(name, "%s%c%s", name, FSDEV_EXT_SEP_CHR, extension);
    ^~~~~~~
</pre>
</pre>


This is normal behaviour when configuring with --enable-cpuhistory, serves as a reminder to us that CPU history recording hasn't been properly implemented for those machines. (Compyx, 2019-11-19)


* compyx (x64, Windows 10/msys2, GCC 8.2.0, SDL2) (r35435)
== clang ==
 
<pre>
Making all in sdl
In file included from ../../../../vice/src/arch/sdl/archdep.c:54:
In function 'system_mbstowcs',
    inlined from 'system_mbstowcs_alloc' at ../../../../vice/src/arch/sdl/archdep_win32.c:197:5,
    inlined from 'archdep_default_logger' at ../../../../vice/src/arch/sdl/archdep_win32.c:401:14:
../../../../vice/src/arch/sdl/archdep_win32.c:184:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
    strncpy(wcs, mbs, len);
    ^~~~~~~~~~~~~~~~~~~~~~
../../../../vice/src/arch/sdl/archdep_win32.c: In function 'archdep_default_logger':
../../../../vice/src/arch/sdl/archdep_win32.c:197:31: note: length computed here
    system_mbstowcs(wcs, mbs, strlen(mbs) + 1);
                              ^~~~~~~~~~~
</pre>


== clang ==
== Other diagnostic tools ==


* gpz (x86, Linux/Gentoo, 64bit, clang 5.0.1, GTK3) (3.2 tarball)
=== IWYU - include-what-you-use ===


CC=clang CXX=clang LD=clang ./configure --enable-native-tools --enable-arch=native --prefix=/usr/games/ --enable-parsid --with-midas --with-resid --with-xaw3d --with-arts --with-x --enable-native-gtk3ui --enable-ethernet --with-pulse --with-sdlsound --enable-fullscreen --enable-cpuhistory --enable-static-ffmpeg
IWYU (https://github.com/include-what-you-use/include-what-you-use) is a tool that scans a codebase and reports on <code>#include</code>'s that are used, might be missing and may not be needed. It should also report on forward declarations and maybe suggest using those (haven't figured that out yet).


note: here compiling using clang breaks in either ffmpeg or resid
It requires clang/llvm and building the actual tool from source using CMake. The instructions could be better and some stuff doesn't work quite right when following the instructions, but it can built and used (TODO: add instructions on how to properly build and use it (the instructions on copying clang's include/ are wrong and few deps on Debian are missing)).


<pre>
Currently it has some false positives when using it on Gtk3-VICE: especially when it scans any Gtk3 code, it outputs a lot of extra <code>#include</code>'s that aren't required, just <code>#include</code>'ing <gtk/gtk.h> will pull in all of the Glib, GIO, GObject, Atk, Pango, Cairo headers our Gtk3 UI requires.
Making all in gfxoutputdrv
ffmpegdrv.c:126:36: warning: missing field 'next_pts' initializer [-Wmissing-field-initializers]
static OutputStream audio_st = { 0 };
                                  ^
ffmpegdrv.c:139:36: warning: missing field 'next_pts' initializer [-Wmissing-field-initializers]
static OutputStream video_st = { 0 };
                                  ^
ffmpegdrv.c:512:24: warning: missing field 'pts' initializer [-Wmissing-field-initializers]
    AVPacket pkt = { 0 };
                      ^
ffmpegdrv.c:981:28: warning: missing field 'pts' initializer [-Wmissing-field-initializers]
        AVPacket pkt = { 0 };
                          ^


Making all in base
As an example, here's a run on Gtk3-VICE on Linux which was configured with:
keysetdialog.c:98:44: warning: suggest braces around initialization of subobject [-Wmissing-braces]
<pre>$ ../vice/configure --enable-native-gtk3ui --enable-debug-gtk3ui --enable-debug --enable-ethernet --with-pulse --with-alsa --with-jpeg --with-png --with-gif --enable-x64</pre>
static GtkWidget *keyset_buttons[3][3] = { NULL };
                                          ^~~~
                                          {  }                                                                                                                                                   
/usr/lib64/llvm/5/bin/../../../../lib/clang/5.0.1/include/stddef.h:105:16: note: expanded from macro 'NULL'
#  define NULL ((void*)0)
              ^~~~~~~~~~
1 warning generated.
videopalettewidget.c:90:9: warning: unused variable 'index' [-Wunused-variable]
    int index = gtk_combo_box_get_active(combo);
        ^
1 warning generated.
ui.c:427:24: warning: unused variable 'tmp' [-Wunused-variable]
                gchar *tmp = g_filename_from_uri(files[i], NULL, NULL);
                      ^
1 warning generated.
uinetplay_new.c:88:9: warning: unused variable 'state' [-Wunused-variable]
    int state = gtk_switch_get_active(widget);
        ^


Making all in ffmpeg
The resulting report is 1.7MB of plain text, so I put it on my DropBox: https://www.dropbox.com/s/rr0v8nz3xyx8dn7/iwyu-clang6-vice-r36405.log?dl=0
In file included from info.c:34:
./infocontrib.h:293:8: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Andr<E9> Fachat <fachat@physik.tu-chemnitz.de>\n"
      ^~~~
./infocontrib.h:343:12: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Paul Dub<E9> \n"
          ^~~~
./infocontrib.h:444:8: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Istv<E1>n F<E1>bi<E1>n\n"
      ^~~~  ~~~~  ~~~~
./infocontrib.h:532:11: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Frank K<F6>nig <frank_koenig@t-online.de>\n"
          ^~~~
./infocontrib.h:571:11: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Marko M<E4>kel<E4> <msmakela@gmail.com>\n"
          ^~~~  ~~~~
./infocontrib.h:622:10: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Lasse <D6><F6>rni <loorni@mail.student.oulu.fi>\n"
        ^~~~~~~~
./infocontrib.h:655:14: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Pablo Rold<E1>n <pdroldan@yahoo.com>\n"
            ^~~~
./infocontrib.h:799:19: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"  Peternel, Per H<E5>kan Sundell and David Horrocks for writing\n"
                  ^~~~
./infocontrib.h:841:25: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
    { "1996-2001", "Andr<E9> Fachat", "Andr<E9> Fachat <fachat@physik.tu-chemnitz.de>" },
                        ^~~~
./infocontrib.h:841:41: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
    { "1996-2001", "Andr<E9> Fachat", "Andr<E9> Fachat <fachat@physik.tu-chemnitz.de>" },
                                          ^~~~
./infocontrib.h:862:29: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
    { "2004-2017", "Paul Dub<E9>", "French", "Paul Dub<E9> " },
                            ^~~~
./infocontrib.h:862:52: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
    { "2004-2017", "Paul Dub<E9>", "French", "Paul Dub<E9> " },
                                                      ^~~~
12 warnings generated.
zfile.c:490:17: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
                !strcasecmp(tmp + l - len, search) != 0) {
                ^                                  ~~
zfile.c:490:17: note: add parentheses after the '!' to evaluate the comparison first
                !strcasecmp(tmp + l - len, search) != 0) {
                ^
                (                                    )                                                                                                                                           
zfile.c:490:17: note: add parentheses around left hand side expression to silence this warning
                !strcasecmp(tmp + l - len, search) != 0) {
                ^
                (                                )                                                                                                                                                 
1 warning generated.
</pre>

Revision as of 20:53, 26 September 2020

GCC

  • Strobe, MSYS2 x64 Gtk3, r38482
magicvoice.c: In function 'magicvoice_mmu_translate':
magicvoice.c:1269:27: warning: array subscript -49152 is outside array bounds of 'uint8_t[16384]' {aka 'unsigned char[16384]'} [-Warray-bounds]
 1269 |                     *base = (uint8_t *)(mv_rom - (uint8_t *)0xc000);
      |                     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
magicvoice.c:132:16: note: while referencing 'mv_rom'
  132 | static uint8_t mv_rom[MV_ROM_SIZE];
      |                ^~~~~~
magicvoice.c:1289:27: warning: array subscript -40960 is outside array bounds of 'uint8_t[16384]' {aka 'unsigned char[16384]'} [-Warray-bounds]
 1289 |                     *base = (uint8_t *)(mv_rom - (uint8_t *)0xa000);
      |                     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
magicvoice.c:132:16: note: while referencing 'mv_rom'
  132 | static uint8_t mv_rom[MV_ROM_SIZE];
      |                ^~~~~~

....

vsidmem.c: In function 'mem_initialize_memory':
vsidmem.c:532:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  532 |         mem_read_base_tab[1][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:533:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  533 |         mem_read_base_tab[2][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:534:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  534 |         mem_read_base_tab[3][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:535:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  535 |         mem_read_base_tab[9][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:536:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  536 |         mem_read_base_tab[10][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:537:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  537 |         mem_read_base_tab[11][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:538:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  538 |         mem_read_base_tab[25][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:539:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  539 |         mem_read_base_tab[26][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
vsidmem.c:540:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  540 |         mem_read_base_tab[27][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vsidmem.c:81:9: note: while referencing 'mem_chargen_rom'
   81 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~

....

c64mem.c: In function 'mem_initialize_memory':
c64mem.c:769:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  769 |         mem_read_base_tab[1][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64mem.c:770:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  770 |         mem_read_base_tab[2][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64mem.c:771:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  771 |         mem_read_base_tab[3][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64mem.c:772:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  772 |         mem_read_base_tab[9][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64mem.c:773:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  773 |         mem_read_base_tab[10][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64mem.c:774:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  774 |         mem_read_base_tab[11][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64mem.c:775:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  775 |         mem_read_base_tab[26][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64mem.c:776:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  776 |         mem_read_base_tab[27][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64mem.c:87:9: note: while referencing 'mem_chargen_rom'
   87 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~

....

c64memsc.c: In function 'mem_initialize_memory':
c64memsc.c:718:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  718 |         mem_read_base_tab[1][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64memsc.c:719:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  719 |         mem_read_base_tab[2][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64memsc.c:720:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  720 |         mem_read_base_tab[3][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64memsc.c:721:33: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  721 |         mem_read_base_tab[9][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64memsc.c:722:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  722 |         mem_read_base_tab[10][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64memsc.c:723:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  723 |         mem_read_base_tab[11][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64memsc.c:724:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  724 |         mem_read_base_tab[26][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~
c64memsc.c:725:34: warning: array subscript -53248 is outside array bounds of 'uint8_t[4096]' {aka 'unsigned char[4096]'} [-Warray-bounds]
  725 |         mem_read_base_tab[27][i] = (uint8_t *)(mem_chargen_rom - (uint8_t *)0xd000);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c64memsc.c:90:9: note: while referencing 'mem_chargen_rom'
   90 | uint8_t mem_chargen_rom[C64_CHARGEN_ROM_SIZE];
      |         ^~~~~~~~~~~~~~~

NOTE remaining warnings are expected as Compyx describes below

c64dtvcpu.c:537:2: warning: #warning "CPUMEMHISTORY implementation for x64dtv is incomplete" [-Wcpp]
  537 | #warning "CPUMEMHISTORY implementation for x64dtv is incomplete"
      |  ^~~~~~~

c128cpu.c:123:2: warning: #warning "CPUMEMHISTORY implementation for x128 is incomplete" [-Wcpp]
  123 | #warning "CPUMEMHISTORY implementation for x128 is incomplete"
      |  ^~~~~~~

petcpu.c:69:2: warning: #warning "CPUMEMHISTORY implementation for xpet is incomplete" [-Wcpp]
   69 | #warning "CPUMEMHISTORY implementation for xpet is incomplete"
      |  ^~~~~~~

plus4cpu.c:40:2: warning: #warning "CPUMEMHISTORY implementation for xplus4 is incomplete" [-Wcpp]
   40 | #warning "CPUMEMHISTORY implementation for xplus4 is incomplete"
      |  ^~~~~~~

cbm2cpu.c:68:2: warning: #warning "CPUMEMHISTORY implementation for xcbm2 is incomplete" [-Wcpp]
   68 | #warning "CPUMEMHISTORY implementation for xcbm2 is incomplete"
      |  ^~~~~~~

This is normal behaviour when configuring with --enable-cpuhistory, serves as a reminder to us that CPU history recording hasn't been properly implemented for those machines. (Compyx, 2019-11-19)

clang

Other diagnostic tools

IWYU - include-what-you-use

IWYU (https://github.com/include-what-you-use/include-what-you-use) is a tool that scans a codebase and reports on #include's that are used, might be missing and may not be needed. It should also report on forward declarations and maybe suggest using those (haven't figured that out yet).

It requires clang/llvm and building the actual tool from source using CMake. The instructions could be better and some stuff doesn't work quite right when following the instructions, but it can built and used (TODO: add instructions on how to properly build and use it (the instructions on copying clang's include/ are wrong and few deps on Debian are missing)).

Currently it has some false positives when using it on Gtk3-VICE: especially when it scans any Gtk3 code, it outputs a lot of extra #include's that aren't required, just #include'ing <gtk/gtk.h> will pull in all of the Glib, GIO, GObject, Atk, Pango, Cairo headers our Gtk3 UI requires.

As an example, here's a run on Gtk3-VICE on Linux which was configured with:

$ ../vice/configure --enable-native-gtk3ui --enable-debug-gtk3ui --enable-debug --enable-ethernet --with-pulse --with-alsa --with-jpeg --with-png --with-gif --enable-x64

The resulting report is 1.7MB of plain text, so I put it on my DropBox: https://www.dropbox.com/s/rr0v8nz3xyx8dn7/iwyu-clang6-vice-r36405.log?dl=0