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 compiler warnings causing Travis failures. #1491

Merged
merged 6 commits into from
Jun 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/IRrecvDumpV2/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ build_flags = -D_IR_LOCALE_=zh-CN ; Chinese (Simplified)
; Build the library with all protocols disabled to flush out #if/#ifdef issues &
; any compiler warnings, by turning them into errors.
[env:shakedown_no_protocols]
build_flags = -D_IR_ENABLE_DEFAULT_=false -Werror
build_flags = -D_IR_ENABLE_DEFAULT_=false -Werror -Wno-error=switch
1 change: 1 addition & 0 deletions examples/SmartIRRepeater/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ board = nodemcuv2
build_flags =
${env.build_flags}
-Werror
-Wno-error=switch
-D_IR_ENABLE_DEFAULT_=false
8 changes: 0 additions & 8 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,8 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_VOLTAS
case decode_type_t::VOLTAS:
#endif
#if SEND_WHIRLPOOL_AC
crankyoldgit marked this conversation as resolved.
Show resolved Hide resolved
case decode_type_t::WHIRLPOOL_AC:
#endif
// Note: Compiler Warning is disabled because someone could disable all
// the protocols before this and it is then unreachable.
// "-Wswitch-unreachable" not used as it appears to be an unknown option.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
return true;
#pragma GCC diagnostic pop
default:
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ extern "C" {

#ifndef USE_IRAM_ATTR
#if defined(ESP8266)
#if defined(IRAM_ATTR)
#define USE_IRAM_ATTR IRAM_ATTR
#else // IRAM_ATTR
#define USE_IRAM_ATTR ICACHE_RAM_ATTR
#endif // IRAM_ATTR
#endif // ESP8266
#if defined(ESP32)
#define USE_IRAM_ATTR IRAM_ATTR
Expand Down