Re: [PATCH] kbuild: Fix -Wimplicit-function-declaration in license_is_gpl_compatible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On 16 Nov 2022, at 18:26, Sam James <sam@xxxxxxxxxx> wrote:
> 
> Add missing <string.h> include for strcmp.
> 
> Clang 16 makes -Wimplicit-function-declaration an error by default. Unfortunately,
> out of tree modules may use this in configure scripts, which means failure
> might cause silent miscompilation or misconfiguration.
> 
> For more information, see LWN.net [0] or LLVM's Discourse [1], gentoo-dev@ [2],
> or the (new) c-std-porting mailing list [3].
> 
> [0] https://lwn.net/Articles/913505/
> [1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
> [2] https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
> [3] hosted at lists.linux.dev.
> 
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: trivial@xxxxxxxxxx
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Sam James <sam@xxxxxxxxxx>
> ---
> include/linux/license.h | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/license.h b/include/linux/license.h
> index 7cce390f120b..1c0f28904ed0 100644
> --- a/include/linux/license.h
> +++ b/include/linux/license.h
> @@ -2,6 +2,8 @@
> #ifndef __LICENSE_H
> #define __LICENSE_H
> 
> +#include <string.h>
> +

Andrew's added this to his tree with the following fixup (duh!):
```
-#include <string.h>
+#include <linux/string.h>
```

Best,
sam

Attachment: signature.asc
Description: Message signed with OpenPGP


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux