]> xenbits.xensource.com Git - xen.git/commit
tools/kdd: mute spurious gcc warning
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Thu, 5 Apr 2018 01:50:55 +0000 (03:50 +0200)
committerWei Liu <wei.liu2@citrix.com>
Fri, 6 Apr 2018 08:06:19 +0000 (09:06 +0100)
commit437e00fea04becc91c1b6bc1c0baa636b067a5cc
tree83082e375958a5f07881a59c9855b4c931ed34af
parent3a633c261426f06627d88bf7feca6ff87f692f16
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>
tools/debugger/kdd/kdd.c