libretro / bsnes2014

Libretro fork of bsnes. As close to upstream as possible.
GNU General Public License v3.0
9 stars 17 forks source link

Silence a -Warray-bounds warning with clang #40

Closed orbea closed 7 years ago

orbea commented 7 years ago

Hopefully correctly silences the following warning with clang-4.0.0.

clang++ -std=gnu++0x -I. -Ilibco -O3 -fomit-frame-pointer -DSFC_LAGFIX -fPIC -D__LIBRETRO__ -DGIT_VERSION=\"" a80dc425"\" -DPROFILE_ACCURACY -c target-libretro/libretro.cpp -o obj/libretro-accuracy.o
target-libretro/libretro.cpp:602:5: warning: array index 6 is past the end of the
      array (which contains 6 elements) [-Warray-bounds]
    data_str[6]=0;
    ^        ~
target-libretro/libretro.cpp:590:3: note: array 'data_str' declared here
  char addr_str[7], data_str[6];
  ^
1 warning generated

I tested cheats and they seem to work correctly.