aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/c++/clang.cpp
diff options
context:
space:
mode:
authorArnd Bergmann <[email protected]>2018-07-06 15:28:32 +0200
committerGreg Kroah-Hartman <[email protected]>2018-07-06 16:36:19 +0200
commit8160eac1213fb6d466dee156638647a71da7d7fb (patch)
tree3132591fd95b2365e0fda3ecc479717e80753435 /tools/perf/util/c++/clang.cpp
parent98a1a0c7a321a46e805df289c7d385a9b1b4c661 (diff)
usb: typec: avoid format-overflow warning
gcc-8 points out that the fix-byte buffer might be too small if desc->mode is a three-digit number: drivers/usb/typec/class.c: In function 'typec_register_altmode': drivers/usb/typec/class.c:502:32: error: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Werror=format-overflow=] sprintf(alt->group_name, "mode%d", desc->mode); ^~ drivers/usb/typec/class.c:502:27: note: directive argument in the range [0, 255] sprintf(alt->group_name, "mode%d", desc->mode); ^~~~~~~~ drivers/usb/typec/class.c:502:2: note: 'sprintf' output between 6 and 8 bytes into a destination of size 6 sprintf(alt->group_name, "mode%d", desc->mode); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I assume this cannot happen in practice, but we can simply make the string long enough to avoid the warning. This uses the two padding bytes that already exist after the string. Fixes: 4ab8c18d4d67 ("usb: typec: Register a device for every mode") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/util/c++/clang.cpp')
0 files changed, 0 insertions, 0 deletions