Skip to content

Commit

Permalink
time: Fix overzealous warning on -Og
Browse files Browse the repository at this point in the history
This var could be uninitialized only when sizeof(periods) == 0,
which is not true: false-positive

DONE: RTOS-943
  • Loading branch information
agkaminski committed Oct 18, 2024
1 parent 18db069 commit 9c558f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion time/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static int epochDaysToYears(int days, int *yearDay)
/* Move day 0 from 1970-01-01 to 2000-02-29. 2000-02-29 closest date when all periods restart.
* Algorithm also works correctly when days < 0.
*/
int year = 2000, leapDay, fullPeriods;
int year = 2000, leapDay = 0, fullPeriods;
days -= 11016;

static const struct {
Expand Down

0 comments on commit 9c558f1

Please sign in to comment.