From bbb869ca80fa299f7888b35134218229521dd0c0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 13 Aug 2019 15:18:34 -0700 Subject: uhd: Add UHD_FALLTHROUGH attribute This provides a platform-independent attribute to allow fallthroughs in switch statements. Example: switch (foo) { case BAR: do_something(); UHD_FALLTHROUGH case BAZ: do_another_thing(); } The usage of UHD_FALLTHROUGH will avoid a compiler warning if indeed the fallthrough was intentional. The associated warning (-Wimplicit-fallthrough) is only available on gcc and Clang. --- host/lib/usrp/usrp1/soft_time_ctrl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.cpp b/host/lib/usrp/usrp1/soft_time_ctrl.cpp index 851f0f507..7f39caf8a 100644 --- a/host/lib/usrp/usrp1/soft_time_ctrl.cpp +++ b/host/lib/usrp/usrp1/soft_time_ctrl.cpp @@ -102,6 +102,7 @@ public: metadata.error_code = rx_metadata_t::ERROR_CODE_BROKEN_CHAIN; _inline_msg_queue.push_with_pop_on_full(metadata); } //continue to next case... + UHD_FALLTHROUGH case stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE: md.end_of_burst = true; this->issue_stream_cmd(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); -- cgit v1.2.3