From 292c1855531df7baab095ef608cda7240984340b Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 30 Jan 2022 02:59:12 +0100 Subject: passt: Address new clang-tidy warnings from LLVM 13.0.1 clang-tidy from LLVM 13.0.1 reports some new warnings from these checkers: - altera-unroll-loops, altera-id-dependent-backward-branch: ignore for the moment being, add a TODO item - bugprone-easily-swappable-parameters: ignore, nothing to do about those - readability-function-cognitive-complexity: ignore for the moment being, add a TODO item - altera-struct-pack-align: ignore, alignment is forced in protocol headers - concurrency-mt-unsafe: ignore for the moment being, add a TODO item Fix bugprone-implicit-widening-of-multiplication-result warnings, though, that's doable and they seem to make sense. Signed-off-by: Stefano Brivio --- conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 9a9dade..abe63a1 100644 --- a/conf.c +++ b/conf.c @@ -867,7 +867,7 @@ void conf(struct ctx *c, int argc, char **argv) for (i = 0; i < ETH_ALEN; i++) { errno = 0; - b = strtol(optarg + i * 3, NULL, 16); + b = strtol(optarg + (intptr_t)i * 3, NULL, 16); if (b < 0 || b > UCHAR_MAX || errno) { err("Invalid MAC address: %s", optarg); usage(argv[0]); @@ -1032,7 +1032,7 @@ void conf(struct ctx *c, int argc, char **argv) case 'M': for (i = 0; i < ETH_ALEN; i++) { errno = 0; - b = strtol(optarg + i * 3, NULL, 16); + b = strtol(optarg + (intptr_t)i * 3, NULL, 16); if (b < 0 || b > UCHAR_MAX || errno) { err("Invalid MAC address: %s", optarg); usage(argv[0]); -- cgit v1.2.3