Skip to content

Commit

Permalink
Fix compiler warnings in openmrn when using new GCC's. (#772)
Browse files Browse the repository at this point in the history
There are a few places where a newer GCC used by esp-idf emits a warning for OpenMRN code. This PR fixes those.

The fall through warning unfortunately has false positives, but that's still not a good reason to disable it, we rather adjust the comments here to suit the taste of the compiler. 

===

* Fix compiler warnings in openmrn when using new GCC's.

* Fix comment.
  • Loading branch information
balazsracz authored Feb 5, 2024
1 parent 8c7cc44 commit 8262386
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/executor/Executor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public:

/// Helper function for debugging and tracing.
/// @return currently running executable or nullptr if none active.
Executable* volatile current() { return current_; }
Executable* current() { return current_; }

protected:
/** Thread entry point.
Expand Down
3 changes: 2 additions & 1 deletion src/freertos_drivers/esp32/Esp32Gpio.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,9 @@ template <class Defs> struct GpioInputPUPD : public GpioInputPin<Defs, true, tru
struct NAME##Defs \
{ \
static const gpio_num_t PIN_NUM = (gpio_num_t)NUM; \
\
public: \
static const gpio_num_t pin() \
static gpio_num_t pin() \
{ \
return PIN_NUM; \
} \
Expand Down
5 changes: 3 additions & 2 deletions src/openlcb/MemoryConfig.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ private:
// Custom spaces cannot do free yet.
return respond_reject(Defs::ERROR_INVALID_ARGS);
}
// Fall through.
}
// Fall through
case MemoryConfigDefs::COMMAND_ENTER_BOOTLOADER:
{
enter_bootloader();
Expand Down Expand Up @@ -733,7 +733,8 @@ private:
return exit();
}
LOG(VERBOSE, "memcfg handler reply: no client registered");
} // fall through to unsupported.
// fall through to unsupported
} // fall through
default:
// Unknown/unsupported command, reject datagram.
return respond_reject(Defs::ERROR_UNIMPLEMENTED_SUBCMD);
Expand Down
2 changes: 1 addition & 1 deletion src/openlcb/SimpleInfoProtocol.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ private:
#if OPENMRN_HAVE_POSIX_FD
case SimpleInfoDescriptor::FILE_CHAR_ARRAY:
open_and_seek_next_file();
// fall through
#endif
// Fall through
case SimpleInfoDescriptor::CHAR_ARRAY:
byteOffset_ = 0;
currentLength_ = d.arg;
Expand Down

0 comments on commit 8262386

Please sign in to comment.