]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/depmod: cast variable in DBG() statement
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 3 Oct 2024 16:02:45 +0000 (17:02 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 9 Oct 2024 04:20:32 +0000 (23:20 -0500)
Older versions of clang (14.0.0 as seen in Ubuntu 22.04) will flag a
warning that we're using unsigned int, with a unsigned char modifier.

Newer versions like 16.0.6 (Debian unstable), 17.0.6 (Alpine), etc do
not flag this as an issue.

In practise the number fits in the latter range, so just add a cast to
silence the warning.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/172
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/depmod.c

index 9461dddd2bd0aa13c2fc5c8c54a1a513ad0105f2..d71c31b737340aad56dd11a4980e9efb80779d6c 100644 (file)
@@ -504,7 +504,7 @@ static int cfg_search_add(struct cfg *cfg, const char *path)
                memcpy(s->path, path, len);
        }
 
-       DBG("search add: %s, search type=%hhu\n", path, type);
+       DBG("search add: %s, search type=%hhu\n", path, (unsigned char)type);
 
        s->next = cfg->searches;
        cfg->searches = s;