<div dir="ltr">thanks. i&#39;ve brought Android up to date with tzcode2013f: <a href="https://android-review.googlesource.com/#/c/66521/">https://android-review.googlesource.com/#/c/66521/</a><div class="gmail_extra"><br><div class="gmail_quote">

On Tue, Sep 24, 2013 at 6:45 PM, Paul Eggert <span dir="ltr">&lt;<a href="mailto:eggert@cs.ucla.edu" target="_blank">eggert@cs.ucla.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Thanks, good catch.  &#39;altzone&#39; too.  These variables were<br>
changed from &#39;long&#39; to &#39;time_t&#39; back in 1987, but (as you note)<br>
that&#39;s incompatible with common practice on the rare hosts where<br>
time_t is not &#39;long&#39;, so we should change them back, as follows<br>
(pushed into the experimental repository on Github):<br>
<br>
>From 6e770de05814b2fec6bc54bc0bace0d7f431fa04 Mon Sep 17 00:00:00 2001<br>
From: Paul Eggert &lt;<a href="mailto:eggert@cs.ucla.edu">eggert@cs.ucla.edu</a>&gt;<br>
Date: Tue, 24 Sep 2013 18:42:34 -0700<br>
Subject: [PATCH] Port to x32 by fixing type incompatibility with POSIX.<br>
<br>
Reported by Elliott Hughes in<br>
&lt;<a href="http://mm.icann.org/pipermail/tz/2013-September/020376.html" target="_blank">http://mm.icann.org/pipermail/tz/2013-September/020376.html</a>&gt;.<br>
* localtime.c (timezone) [USG_COMPAT]:<br>
(altzone) [ALTZONE]: Now long, not time_t.<br>
* strftime.c (_fmt): Use long, not int, to store timezone.<br>
* NEWS: Document this.<br>
---<br>
 NEWS        | 10 ++++++++++<br>
 localtime.c |  4 ++--<br>
 strftime.c  |  2 +-<br>
 3 files changed, 13 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/NEWS b/NEWS<br>
index c1e8ba3..355aea6 100644<br>
--- a/NEWS<br>
+++ b/NEWS<br>
@@ -13,6 +13,16 @@ Unreleased, experimental changes<br>
<br>
     Palestine will fall back at 00:00, not 01:00.  (Thanks to Steffen Thorsen.)<br>
<br>
+  Changes affecting API<br>
+<br>
+    The types of the global variables &#39;timezone&#39; and &#39;altzone&#39; (if present)<br>
+    have been changed back to &#39;long&#39;.  This is required for &#39;timezone&#39;<br>
+    by POSIX, and for &#39;altzone&#39; by common practice, e.g., Solaris 11.<br>
+    These variables were originally &#39;long&#39; in the tz code, but were<br>
+    mistakenly changed to &#39;time_t&#39; in 1987; nobody reported the<br>
+    incompatibility until now.  The difference matters on x32, where<br>
+    &#39;long&#39; is 32 bits and &#39;time_t&#39; is 64.  (Thanks to Elliott Hughes.)<br>
+<br>
   Changes affecting the build procedure<br>
<br>
     Avoid long strings in leapseconds.awk to work around a mawk bug.<br>
diff --git a/localtime.c b/localtime.c<br>
index f2004b5..8c8edf3 100644<br>
--- a/localtime.c<br>
+++ b/localtime.c<br>
@@ -215,12 +215,12 @@ char *                    tzname[2] = {<br>
 static struct tm       tm;<br>
<br>
 #ifdef USG_COMPAT<br>
-time_t                 timezone = 0;<br>
+long                   timezone = 0;<br>
 int                    daylight = 0;<br>
 #endif /* defined USG_COMPAT */<br>
<br>
 #ifdef ALTZONE<br>
-time_t                 altzone = 0;<br>
+long                   altzone = 0;<br>
 #endif /* defined ALTZONE */<br>
<br>
 static int_fast32_t<br>
diff --git a/strftime.c b/strftime.c<br>
index aba3d33..c324f1b 100644<br>
--- a/strftime.c<br>
+++ b/strftime.c<br>
@@ -492,7 +492,7 @@ label:<br>
                                continue;<br>
                        case &#39;z&#39;:<br>
                                {<br>
-                               int             diff;<br>
+                               long            diff;<br>
                                char const *    sign;<br>
<br>
                                if (t-&gt;tm_isdst &lt; 0)<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.2<br>
<br>
<br>
</font></span></blockquote></div><br><br>
</div></div>