From 5328813814b52178e296a8cb8122825e98a0deaf Mon Sep 17 00:00:00 2001 From: MakerYuichi <106516578+MakerYuichi@users.noreply.github.com> Date: Wed, 26 Aug 2026 22:13:55 +0530 Subject: [PATCH] [time] Silence compiler warning by initializing transit variables (#18715) (#18723) Co-authored-by: doraemon2200 <106516578+doraemon2200@users.noreply.github.com> --- esphome/components/time/posix_tz.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/time/posix_tz.cpp b/esphome/components/time/posix_tz.cpp index 188df599f6..002aadfec3 100644 --- a/esphome/components/time/posix_tz.cpp +++ b/esphome/components/time/posix_tz.cpp @@ -178,7 +178,8 @@ static int __attribute__((noinline)) days_from_year_start(int year, int month, i } time_t __attribute__((noinline)) calculate_dst_transition(int year, const DSTRule &rule, int32_t base_offset_seconds) { - int month, day; + int month = 1; + int day = 1; switch (rule.type) { case DSTRuleType::MONTH_WEEK_DAY: {