bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] time_rz: port to clang -Wunused-const-variable


From: Paul Eggert
Subject: [PATCH] time_rz: port to clang -Wunused-const-variable
Date: Tue, 15 Mar 2016 13:11:34 -0700

* lib/time_rz.c (TZ): Remove.  All uses removed.
---
 ChangeLog     | 3 +++
 lib/time_rz.c | 6 ++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d71f8b3..49180d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-03-15  Paul Eggert  <address@hidden>
 
+       time_rz: port to clang -Wunused-const-variable
+       * lib/time_rz.c (TZ): Remove.  All uses removed.
+
        std-gnu11: improve clang support
        * m4/std-gnu11.m4: Sync with autoconf, incorporating:
        2016-03-15 Also try clang
diff --git a/lib/time_rz.c b/lib/time_rz.c
index 56f3220..10a006c 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -47,8 +47,6 @@ enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
    used.  */
 enum { ABBR_SIZE_MIN = DEFAULT_MXFAST - offsetof (struct tm_zone, abbrs) };
 
-static char const TZ[] = "TZ";
-
 /* Magic cookie timezone_t value, for local time.  It differs from
    NULL and from all other timezone_t values.  Only the address
    matters; the pointer is never dereferenced.  */
@@ -205,7 +203,7 @@ tzfree (timezone_t tz)
 static char *
 getenv_TZ (void)
 {
-  return getenv (TZ);
+  return getenv ("TZ");
 }
 #endif
 
@@ -213,7 +211,7 @@ getenv_TZ (void)
 static int
 setenv_TZ (char const *tz)
 {
-  return tz ? setenv (TZ, tz, 1) : unsetenv (TZ);
+  return tz ? setenv ("TZ", tz, 1) : unsetenv ("TZ");
 }
 #endif
 
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]