fsf address update
[gnulib.git] / lib / posixtm.c
index 22f636e..402d59a 100644 (file)
@@ -1,6 +1,6 @@
 /* Parse dates for touch and date.
 
-   Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004
+   Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation Inc.
 
    This program is free software; you can redistribute it and/or modify
 #endif
 
 #include "posixtm.h"
-#include "unlocked-io.h"
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
 
 /* ISDIGIT differs from isdigit, as follows:
    - Its arg may be any int or unsigned int; it need not be an unsigned char.
@@ -195,6 +198,14 @@ posixtime (time_t *p, const char *s, unsigned int syntax_bits)
   struct tm const *tm;
   time_t t;
 
+#ifdef lint
+  /* Placate gcc-4's -Wuninitialized.
+     posix_time_parse fails to set tm0.tm_year only when it returns
+     nonzero (due to year() returning nonzero), and in that case,
+     this code doesn't use the tm0 at all.  */
+  tm0.tm_year = 0;
+#endif
+
   if (posix_time_parse (&tm0, s, syntax_bits))
     return false;