Comment by drysine 16 hours ago And developers never forget to check error codes. 4 comments drysine Reply listeria 7 hours ago may I introduce you to the nodiscard attribute[1]? enum (class)? [[nodiscard]] Error { Ok, NoMem, ... }; [1]: https://en.cppreference.com/w/cpp/language/attributes/nodisc... drysine 7 hours ago C attribute: nodiscard (since C23) [1] https://en.cppreference.com/w/c/language/attributes/nodiscar... senderista 1 hour ago FWIW I’ve been using warn_unused_result in both gcc and clang since about 2020. dan00 11 hours ago Looking at code, it‘s easier to spot the missing check for an error code, than a not catched exceptions.Also error codes are part of the signature of a function, which exceptions aren‘t.
listeria 7 hours ago may I introduce you to the nodiscard attribute[1]? enum (class)? [[nodiscard]] Error { Ok, NoMem, ... }; [1]: https://en.cppreference.com/w/cpp/language/attributes/nodisc... drysine 7 hours ago C attribute: nodiscard (since C23) [1] https://en.cppreference.com/w/c/language/attributes/nodiscar... senderista 1 hour ago FWIW I’ve been using warn_unused_result in both gcc and clang since about 2020.
drysine 7 hours ago C attribute: nodiscard (since C23) [1] https://en.cppreference.com/w/c/language/attributes/nodiscar... senderista 1 hour ago FWIW I’ve been using warn_unused_result in both gcc and clang since about 2020.
senderista 1 hour ago FWIW I’ve been using warn_unused_result in both gcc and clang since about 2020.
dan00 11 hours ago Looking at code, it‘s easier to spot the missing check for an error code, than a not catched exceptions.Also error codes are part of the signature of a function, which exceptions aren‘t.
may I introduce you to the nodiscard attribute[1]?
[1]: https://en.cppreference.com/w/cpp/language/attributes/nodisc...
[1] https://en.cppreference.com/w/c/language/attributes/nodiscar...
FWIW I’ve been using warn_unused_result in both gcc and clang since about 2020.
Looking at code, it‘s easier to spot the missing check for an error code, than a not catched exceptions.
Also error codes are part of the signature of a function, which exceptions aren‘t.