[PATCH v7 01/14] time: Protect the print_timezone() function

Dmitry V. Levin ldv at altlinux.org
Sun Apr 19 21:55:18 UTC 2020


On Fri, Apr 17, 2020 at 09:47:11AM -0700, Alistair Francis wrote:
> To avoid the following error:
> time.c:17:1: error: 'print_timezone' defined but not used [-Werror=unused-function]
> 
> ensure that print_timezone is only defined if we are going to use it.
> 
> Signed-off-by: Alistair Francis <alistair.francis at wdc.com>
> ---
>  time.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/time.c b/time.c
> index 03863e26..cfc0324c 100644
> --- a/time.c
> +++ b/time.c
> @@ -13,6 +13,7 @@
>  #include <signal.h>
>  #include <sys/timex.h>
>  
> +#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS || defined(ALPHA)
>  static void
>  print_timezone(struct tcb *const tcp, const kernel_ulong_t addr)
>  {
> @@ -24,6 +25,7 @@ print_timezone(struct tcb *const tcp, const kernel_ulong_t addr)
>  	tprintf("{tz_minuteswest=%d, tz_dsttime=%d}",
>  		tz.tz_minuteswest, tz.tz_dsttime);
>  }
> +#endif

As ALPHA definitely has HAVE_ARCH_OLD_TIME64_SYSCALLS defined,
I applied a slightly simplified edition of this patch.


-- 
ldv


More information about the Strace-devel mailing list