aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/scripting-engines/trace-event-perl.c
diff options
context:
space:
mode:
authorJustin Stitt <[email protected]>2022-07-08 17:37:04 -0700
committerSteffen Klassert <[email protected]>2022-07-12 12:58:53 +0200
commite79b9473e9b59e83e23db9b7411c6080b5a6826d (patch)
tree5fcc14b11be11307dd7e0c6ad3ddce20f8a5fb52 /tools/perf/util/scripting-engines/trace-event-perl.c
parentf85daf0e725358be78dfd208dea5fd665d8cb901 (diff)
net: ipv4: fix clang -Wformat warnings
When building with Clang we encounter these warnings: | net/ipv4/ah4.c:513:4: error: format specifies type 'unsigned short' but | the argument has type 'int' [-Werror,-Wformat] | aalg_desc->uinfo.auth.icv_fullbits / 8); - | net/ipv4/esp4.c:1114:5: error: format specifies type 'unsigned short' | but the argument has type 'int' [-Werror,-Wformat] | aalg_desc->uinfo.auth.icv_fullbits / 8); `aalg_desc->uinfo.auth.icv_fullbits` is a u16 but due to default argument promotion becomes an int. Variadic functions (printf-like) undergo default argument promotion. Documentation/core-api/printk-formats.rst specifically recommends using the promoted-to-type's format flag. As per C11 6.3.1.1: (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) `If an int can represent all values of the original type ..., the value is converted to an int; otherwise, it is converted to an unsigned int. These are called the integer promotions.` Thus it makes sense to change %hu to %d not only to follow this standard but to suppress the warning as well. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Justin Stitt <[email protected]> Suggested-by: Joe Perches <[email protected]> Suggested-by: Nathan Chancellor <[email protected]> Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
0 files changed, 0 insertions, 0 deletions