diff --git a/AK/Base64.cpp b/AK/Base64.cpp index 906a608569..04e67e6b54 100644 --- a/AK/Base64.cpp +++ b/AK/Base64.cpp @@ -87,10 +87,7 @@ ByteBuffer decode_base64(const StringView& input) output.append(out2); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" return ByteBuffer::copy(output.data(), output.size()); -#pragma GCC diagnostic pop } String encode_base64(ReadonlyBytes input) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac9fe49211..6532785451 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,6 +218,7 @@ add_compile_options(-Wno-unknown-warning-option) add_compile_options(-Wundef) add_compile_options(-Wunused) add_compile_options(-Wwrite-strings) +add_compile_options(-Wno-maybe-uninitialized) add_compile_options(-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.) add_compile_options(-fno-exceptions) diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index 754f18a40e..e9a47d2a53 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -120,15 +120,7 @@ KResultOr handle(RegisterState& regs, FlatPtr function, FlatPtr arg1, F return ENOSYS; } - // This appears to be a bogus warning, as s_syscall_table is always - // initialized, and the index (function) is always bounded. - // TODO: Figure out how to avoid the suppression. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" - return (process.*(s_syscall_table[function]))(arg1, arg2, arg3); - -#pragma GCC diagnostic pop } } diff --git a/Userland/Libraries/LibGUI/Label.cpp b/Userland/Libraries/LibGUI/Label.cpp index 2231373662..88a829bf87 100644 --- a/Userland/Libraries/LibGUI/Label.cpp +++ b/Userland/Libraries/LibGUI/Label.cpp @@ -142,10 +142,7 @@ void Label::wrap_text() case '\t': case ' ': { if (start.has_value()) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" words.append(m_text.substring(start.value(), i - start.value())); -#pragma GCC diagnostic pop start.clear(); continue; } diff --git a/Userland/Utilities/crash.cpp b/Userland/Utilities/crash.cpp index e832915826..e6c9b13d9d 100644 --- a/Userland/Utilities/crash.cpp +++ b/Userland/Utilities/crash.cpp @@ -118,10 +118,7 @@ int main(int argc, char** argv) if (!uninitialized_memory) return Crash::Failure::UnexpectedError; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" [[maybe_unused]] volatile auto x = uninitialized_memory[0][0]; -#pragma GCC diagnostic pop return Crash::Failure::DidNotCrash; }).run(run_type); } @@ -144,10 +141,7 @@ int main(int argc, char** argv) if (!uninitialized_memory) return Crash::Failure::UnexpectedError; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" uninitialized_memory[4][0] = 1; -#pragma GCC diagnostic pop return Crash::Failure::DidNotCrash; }).run(run_type); }