]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commit
Silence GCC 8 compiler warning in ShowEA()
authorThomas Huth <huth@tuxfamily.org>
Mon, 21 May 2018 03:20:08 +0000 (05:20 +0200)
committerThomas Huth <huth@tuxfamily.org>
Mon, 21 May 2018 03:43:54 +0000 (05:43 +0200)
commit137dcb36dbcce15805180dfa534551cf47563828
tree5b21543079736fc2255011b7dba18b4e61e50aff
parent14078f67daf6b42c53588c490789adee7cbf2146
Silence GCC 8 compiler warning in ShowEA()

The current version of GCC has gained the possibility to do some additional
checks for string operation buffer overflows. It is using the size of
source arrays for the check, so in ShowEA it is currently reporting (output
taken from Hatari build):

newcpu.c: In function 'ShowEA.constprop':
newcpu.c:2440:26: warning: '%s' directive writing up to 79 bytes into a
 region of size between 73 and 75 [-Wformat-overflow=]
    _stprintf (buffer, _T("(A%d, %s) == $%08x"), reg, offtxt, addr);

The offtxt array is only storing a string for a short displacement, so
80 characters is way too big here. Decreasing the size of the array to
less characters silences the compiler warning for me.
newcpu.cpp