Skip to content

Commit

Permalink
kbuild: Fix -Wimplicit-function-declaration in license_is_gpl_compatible
Browse files Browse the repository at this point in the history
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@linux-foundation.org>
Cc: trivial@kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam authored and intel-lab-lkp committed Nov 16, 2022
1 parent 4db0885 commit f9de22a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/license.h
Expand Up @@ -2,6 +2,8 @@
#ifndef __LICENSE_H
#define __LICENSE_H

#include <string.h>

static inline int license_is_gpl_compatible(const char *license)
{
return (strcmp(license, "GPL") == 0
Expand Down

0 comments on commit f9de22a

Please sign in to comment.