Re: [patch] compiler, clang: move inline definition to compiler-gcc.h

From: Matthias Kaehlcke
Date: Wed Jun 07 2017 - 12:41:49 EST


El Tue, Jun 06, 2017 at 10:56:49PM -0700 David Rientjes ha dit:

> The motivation of commit abb2ea7dfd82 ("compiler, clang: suppress warning
> for unused static inline functions") is to suppress clang's warnings about
> unused static inline functions.
>
> Clang defines __GNUC__ so it inherits all of compiler-gcc.h as well, so
> the redefinition of `inline' ends up overriding the definition in
> compiler-gcc.h.
>
> Simply annotate all inline functions as __attribute__((unused)). It's
> necessary to suppress the warning for clang and is implicit with gcc.
>
> Reported-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
> Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
> ---

Tested-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>