Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI failure due to unused variables #265

Merged
merged 1 commit into from
Aug 9, 2022

Conversation

edgar-bonet
Copy link
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
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