Re: kconfig: include <strings.h> to fix bcmp build error on Clang

From: Masahiro Yamada
Date: Sun Jun 15 2025 - 12:06:03 EST


On Sun, Jun 15, 2025 at 10:59 PM Z-Script Zs <zscript.team.zs@xxxxxxxxx> wrote:
>
> Hi,
>
> This patch fixes a build error caused by missing <strings.h> when compiling
> with Clang in strict ISO C environments such as Termux or Android.
>
> The function 'bcmp' is used in scripts/kconfig/confdata.c, but without
> including <strings.h>, the build fails under strict C99 rules due to an
> implicit declaration.
>
> I'm 12 years old and just starting to learn Linux kernel development.
> This is my first patch submission. I'd be very grateful for any feedback or corrections.
>
> Thank you for your time and for maintaining this incredible project.

Congratulations for your first patch submission, but
I prefer replacing bcmp() with memcmp() because
"man bcmp" recommends doing so:


SYNOPSIS
#include <strings.h>

[[deprecated]] int bcmp(const void s1[.n], const void s2[.n], size_t n);

DESCRIPTION
bcmp() is identical to memcmp(3); use the latter instead.



The patch already exists:
https://lore.kernel.org/linux-kbuild/rxsikukdh39.fsf@xxxxxxxxxxxxxx-host-address-is-not-set/


When I communicated last time, I did not get v2 somehow.

I will apply that, updating the commit description myself.

Thanks.





--
Best Regards
Masahiro Yamada