[Pdbg] [PATCH 1/6] libpdbg: Fix clang warning -Wunused-function
Alistair Popple
alistair at popple.id.au
Tue Jul 2 12:00:11 AEST 2019
Reviewed-by: Alistair Popple <alistair at popple.id.au>
On Wednesday, 19 June 2019 1:15:45 PM AEST Amitay Isaacs wrote:
> The *_check() functions are never going to be called.
>
> ../../libpdbg/adu.c:583:1: error: unused function 'p8_adu_hw_unit_check'
> [-Werror,-Wunused-function] DECLARE_HW_UNIT(p8_adu);
> ^
> ../../libpdbg/hwunit.h:43:21: note: expanded from macro 'DECLARE_HW_UNIT'
> static inline void name ##_hw_unit_check(void) { \
>
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
> libpdbg/hwunit.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h
> index 117e622..b816ae3 100644
> --- a/libpdbg/hwunit.h
> +++ b/libpdbg/hwunit.h
> @@ -40,7 +40,7 @@ const struct hw_unit_info
> *pdbg_hwunit_find_compatible(const char *compat); * container struct. Not
> doing so will break other assumptions.
> */
> #define DECLARE_HW_UNIT(name) \
> - static inline void name ##_hw_unit_check(void) { \
> + __attribute__((unused)) static inline void name ##_hw_unit_check(void) {
\
> ((void)sizeof(char[1 - 2 * (container_off(typeof(name), target) != 0)])); \
> } \
> const struct hw_unit_info __used name ##_hw_unit = \
More information about the Pdbg
mailing list