This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "postpone perl_parse() exit(0) bugfix"
[perl5.git] / time64.c
index bbcef8e..1d637e9 100644 (file)
--- a/time64.c
+++ b/time64.c
@@ -26,6 +26,33 @@ THE SOFTWARE.
 
 */
 
+
+/*
+ *   This thing all things devours:
+ *   Birds, beasts, trees, flowers;
+ *   Gnaws iron, bites steel;
+ *   Grinds hard stones to meal;
+ *   Slays king, ruins town,
+ *   And beats high mountain down."
+ *
+ * Poor Bilbo sat in the dark thinking of all the horrible names of all the
+ * giants and ogres he had ever heard told of in tales, but not one of them had
+ * done all these things. He had a feeling that the answer was quite different
+ * and that he ought to know it, but he could not think of it. He began to get
+ * frightened, and that is bad for thinking. Gollum began to get out of his
+ * boat. He flapped into the water and paddled to the bank; Bilbo could see his
+ * eyes coming towards him. His tongue seemed to stick in his mouth; he wanted
+ * to shout out: "Give me more time! Give me time!" But all that came out with
+ * a sudden squeal was:
+ *
+ * "Time! Time!"
+ *
+ * Bilbo was saved by pure luck. For that of course was the answer.
+ *
+ *     [p.84 of _The Hobbit_: "Riddles in the Dark"]
+ *
+*/
+
 /*
 
 Programmers who have available to them 64-bit time values as a 'long
@@ -374,7 +401,7 @@ struct TM *Perl_gmtime64_r (const Time64_T *in_time, struct TM *p)
     p->tm_isdst  = 0;
 
 #ifdef HAS_TM_TM_ZONE
-    p->tm_zone   = (char *)"UTC";
+    p->tm_zone   = "UTC";
 #endif
 
     v_tm_sec  = (int)Perl_fmod(time, 60.0);
@@ -479,7 +506,7 @@ struct TM *Perl_localtime64_r (const Time64_T *time, struct TM *local_tm)
     struct tm safe_date;
     const struct tm * result;
     struct TM gm_tm;
-    Year orig_year;
+    Year orig_year = 0; /* initialise to avoid spurious compiler warning */
     int month_diff;
     const bool use_system = SHOULD_USE_SYSTEM_LOCALTIME(*time);
     dTHX;