]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kconfig: use memcmp instead of deprecated bcmp
authorThomas Meyer <thomas@m3y3r.de>
Tue, 24 Sep 2024 18:47:22 +0000 (20:47 +0200)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 18 Jun 2025 01:11:15 +0000 (10:11 +0900)
bcmp() was removed in POSIX.1-2008.

This commit replaces bcmp() with memcmp(). This allows Kconfig to link
with C libraries that do not provide bcmp(), such as Android bionic
libc.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Reported-by: Abhigyan Ghosh <zscript.team.zs@gmail.com>
[masahiro: update commit description]
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/confdata.c

index ac95661a1c9dd9b8a059d6a5d6a2f7885894382b..9599a0408862548d86e6449c3ed9472bdfb144e1 100644 (file)
@@ -77,7 +77,7 @@ static bool is_same(const char *file1, const char *file2)
        if (map2 == MAP_FAILED)
                goto close2;
 
-       if (bcmp(map1, map2, st1.st_size))
+       if (memcmp(map1, map2, st1.st_size))
                goto close2;
 
        ret = true;