mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +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
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