Skip to content

Fix CI failure due to unused variables#265

Merged
caternuson merged 1 commit into
adafruit:masterfrom
edgar-bonet:fix-warning
Aug 9, 2022
Merged

Fix CI failure due to unused variables#265
caternuson merged 1 commit into
adafruit:masterfrom
edgar-bonet:fix-warning

Conversation

@edgar-bonet

Copy link
Copy Markdown
Contributor

Since the merge of PR #257, the CI workflow has been failing in “test platforms”. The failure is due to errors while compiling the example sketch DS3231_alarm.ino on ESP32:

DS3231_alarm.ino:70:14: error: variable 'alarm1' set but not used [-Werror=unused-but-set-variable]
       DateTime alarm1 = rtc.getAlarm1();
                ^~~~~~
DS3231_alarm.ino:71:22: error: unused variable 'alarm1mode' [-Werror=unused-variable]
       Ds3231Alarm1Mode alarm1mode = rtc.getAlarm1Mode();
                        ^~~~~~~~~~
  cc1plus: some warnings being treated as errors

On the other platforms being tested, the same warnings show up. However, only the ESP32 toolchain is promoting warnings to errors.

Fix this by using the variables instead of recomputing their values later.

These unused variables were triggering compiler warnings. As the ESP32
toolchain promotes warnings to errors, this made the CI workflow fail.
@caternuson

Copy link
Copy Markdown
Contributor

Thanks!

@caternuson caternuson merged commit a944a78 into adafruit:master Aug 9, 2022
@edgar-bonet edgar-bonet deleted the fix-warning branch August 9, 2022 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants