diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-06-09 20:21:17 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-09 23:05:32 +0430 |
commit | 50349de38c9427b80603c4ef7db9022abf4a9894 (patch) | |
tree | 45f840b89bf9b4884ad7f7cc14c163a0e5ab33b4 /Kernel | |
parent | 45710d07245c4f01ed6ec9c28a221f81ad13e823 (diff) | |
download | serenity-50349de38c9427b80603c4ef7db9022abf4a9894.zip |
Meta: Disable -Wmaybe-uninitialized
It's prone to finding "technically uninitialized but can never happen"
cases, particularly in Optional<T> and Variant<Ts...>.
The general case seems to be that it cannot infer the dependency
between Variant's index (or Optional's boolean state) and a particular
alternative (or Optional's buffer) being untouched.
So it can flag cases like this:
```c++
if (index == StaticIndexForF)
new (new_buffer) F(move(*bit_cast<F*>(old_buffer)));
```
The code in that branch can _technically_ make a partially initialized
`F`, but that path can never be taken since the buffer holding an
object of type `F` and the condition being true are correlated, and so
will never be taken _unless_ the buffer holds an object of type `F`.
This commit also removed the various 'diagnostic ignored' pragmas used
to work around this warning, as they no longer do anything.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Syscall.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
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<FlatPtr> 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 } } |