From 80318b9ae07bab131b80d4828fbd03c9bc875118 Mon Sep 17 00:00:00 2001 From: Piotr Tworek Date: Tue, 12 Jan 2021 00:38:44 +0100 Subject: [PATCH] libc: Add semicolons after [[fallthrough]] GCC doesn't care, but clang complains if [[fallthrough]] is not followed by a semicolon. Existing Genode code is also not consitent in this regard. This patch adds the extra semicolons since it works in both GCC and clang. Issue #3985 --- repos/libports/src/lib/libc/fork.cc | 2 +- repos/libports/src/lib/libc/vfs_plugin.cc | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/repos/libports/src/lib/libc/fork.cc b/repos/libports/src/lib/libc/fork.cc index eb434659b5..4a2f6d54a1 100644 --- a/repos/libports/src/lib/libc/fork.cc +++ b/repos/libports/src/lib/libc/fork.cc @@ -626,7 +626,7 @@ extern "C" pid_t __sys_fork(void) switch (stage) { case Stage::FORK: child = fork_kernel_routine(); - stage = Stage::WAIT_FORK_READY; [[ fallthrough ]] + stage = Stage::WAIT_FORK_READY; [[ fallthrough ]]; case Stage::WAIT_FORK_READY: if (child->running() || child->exited()) { return Fn::COMPLETE; diff --git a/repos/libports/src/lib/libc/vfs_plugin.cc b/repos/libports/src/lib/libc/vfs_plugin.cc index 0947e44740..848b6d09da 100644 --- a/repos/libports/src/lib/libc/vfs_plugin.cc +++ b/repos/libports/src/lib/libc/vfs_plugin.cc @@ -554,15 +554,15 @@ struct Sync case Sync::INITIAL: if (!vfs_handle.fs().update_modification_timestamp(&vfs_handle, mtime)) return false; - state = Sync::TIMESTAMP_UPDATED; [[ fallthrough ]] + state = Sync::TIMESTAMP_UPDATED; [[ fallthrough ]]; case Sync::TIMESTAMP_UPDATED: if (!vfs_handle.fs().queue_sync(&vfs_handle)) return false; - state = Sync::QUEUED; [[ fallthrough ]] + state = Sync::QUEUED; [[ fallthrough ]]; case Sync::QUEUED: if (vfs_handle.fs().complete_sync(&vfs_handle) == Vfs::File_io_service::SYNC_QUEUED) return false; - state = Sync::COMPLETE; [[ fallthrough ]] + state = Sync::COMPLETE; [[ fallthrough ]]; case Sync::COMPLETE: break; } @@ -1717,7 +1717,7 @@ int Libc::Vfs_plugin::symlink(const char *target_path, const char *link_path) handle->handler(&_response_handler); sync.construct(*handle, _update_mtime, _current_real_time); - } stage = Stage::WRITE; [[fallthrough]] + } stage = Stage::WRITE; [[fallthrough]]; case Stage::WRITE: { @@ -1726,7 +1726,7 @@ int Libc::Vfs_plugin::symlink(const char *target_path, const char *link_path) } catch (Vfs::File_io_service::Insufficient_buffer) { return Fn::INCOMPLETE; } - } stage = Stage::SYNC; [[fallthrough]] + } stage = Stage::SYNC; [[fallthrough]]; case Stage::SYNC: { @@ -1787,13 +1787,13 @@ ssize_t Libc::Vfs_plugin::readlink(const char *link_path, char *buf, ::size_t bu } handle->handler(&_response_handler); - } stage = Stage::QUEUE_READ; [[ fallthrough ]] + } stage = Stage::QUEUE_READ; [[ fallthrough ]]; case Stage::QUEUE_READ: { if (!handle->fs().queue_read(handle, buf_size)) return Fn::INCOMPLETE; - } stage = Stage::COMPLETE_READ; [[ fallthrough ]] + } stage = Stage::COMPLETE_READ; [[ fallthrough ]]; case Stage::COMPLETE_READ: {