[tz] [PATCH] Pacify gcc -Wunused-parameter
Paul Eggert
eggert at cs.ucla.edu
Wed Mar 22 18:00:22 UTC 2023
* zdump.c (localtime_rz, tzfree): [! USE_LOCALTIME_RZ]:
Mark unused args with ATTRIBUTE_MAYBE_UNUSED. Problem found when
compiling with -DUSE_LTZ=0 on Fedora 37 with GCC 12.2.1 20221121
(Red Hat 12.2.1-4).
---
zdump.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/zdump.c b/zdump.c
index 77ecb18..88bcd3a 100644
--- a/zdump.c
+++ b/zdump.c
@@ -228,7 +228,7 @@ localtime_r(time_t *tp, struct tm *tmp)
# undef localtime_rz
# define localtime_rz zdump_localtime_rz
static struct tm *
-localtime_rz(timezone_t rz, time_t *tp, struct tm *tmp)
+localtime_rz(ATTRIBUTE_MAYBE_UNUSED timezone_t rz, time_t *tp, struct tm *tmp)
{
return localtime_r(tp, tmp);
}
@@ -304,7 +304,7 @@ tzalloc(char const *val)
}
static void
-tzfree(timezone_t initial_environ)
+tzfree(ATTRIBUTE_MAYBE_UNUSED timezone_t initial_environ)
{
# if !HAVE_SETENV
environ = initial_environ;
--
2.39.2
More information about the tz
mailing list