tools/kdd: mute spurious gcc warning
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Thu, 5 Apr 2018 01:50:55 +0000 (03:50 +0200)
committerHans van Kranenburg <hans@knorrie.org>
Tue, 7 Jan 2020 19:23:20 +0000 (20:23 +0100)
commit1cadaca40196d92b2f96a2bdb7974395765149f4
tree8c68adc943b1e25e568c93731f5b5ea699a75a76
parent7f82c0ccfea028a0989c900714080875702c52c2
tools/kdd: mute spurious gcc warning

gcc-8 complains:

    kdd.c:698:13: error: 'memcpy' offset [-204, -717] is out of the bounds [0, 216] of object 'ctrl' with type 'kdd_ctrl' {aka 'union <anonymous>'} [-Werror=array-bounds]
                 memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    kdd.c: In function 'kdd_select_callback':
    kdd.c:642:14: note: 'ctrl' declared here
         kdd_ctrl ctrl;
                  ^~~~

But this is impossible - 'offset' is unsigned and correctly validated
few lines before.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-Acked-by: Juergen Gross <jgross@suse.com>
(cherry picked from commit 437e00fea04becc91c1b6bc1c0baa636b067a5cc)
tools/debugger/kdd/kdd.c