mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
Kernel: Decorate KResultOr with [[nodiscard]] to catch misbehaving callers
The [[nodiscard]] decorator enables us to have the compile emit a warning anytime the decorated type or function's return value isn't observed. It's very useful for catching error checking bugs in systems which use C style error handling.
This commit is contained in:
parent
e8c9b5e870
commit
ea3ee4f3f3
Notes:
sideshowbarker
2024-07-19 04:17:34 +09:00
Author: https://github.com/bgianfo
Commit: ea3ee4f3f3
Pull-request: https://github.com/SerenityOS/serenity/pull/2999
1 changed files with 1 additions and 1 deletions
|
@ -61,7 +61,7 @@ private:
|
|||
};
|
||||
|
||||
template<typename T>
|
||||
class alignas(T) KResultOr {
|
||||
class alignas(T) [[nodiscard]] KResultOr {
|
||||
public:
|
||||
KResultOr(KResult error)
|
||||
: m_error(error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue