summaryrefslogtreecommitdiff
path: root/time64.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2020-12-03 10:36:42 +0000
committerDavid Mitchell <davem@iabyn.com>2020-12-03 10:36:42 +0000
commit153764ac87c44440fea60466e8f718671117bac2 (patch)
tree12bf481a9ff006ac078840c4b2dd237f521bd4e6 /time64.c
parent7de4500e1bc038d5be4ef2683c4bfab617a58a9b (diff)
downloadperl-153764ac87c44440fea60466e8f718671117bac2.tar.gz
time64.c: avoid 'uninit' compiler warning
clang isn't smart enough to recognise the pattern: if (foo) { ...} { else orig_year = ... } ... if (!foo) { ... use orig_year .. } So just unconditionally initialise orig_year.
Diffstat (limited to 'time64.c')
-rw-r--r--time64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/time64.c b/time64.c
index 7fc50af13d..52d99cda7a 100644
--- a/time64.c
+++ b/time64.c
@@ -479,7 +479,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;