mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
lib: define macro NODISCARD
In either C++17 (or later) mode, or when running cppcheck, this can be used to selectively generate warnings about discarded return values.
This commit is contained in:
parent
bc80ff829a
commit
7d5a9bd3ae
1 changed files with 6 additions and 0 deletions
|
@ -750,6 +750,12 @@ _notmuch_talloc_steal (const void *new_ctx, const T *ptr)
|
|||
#undef talloc_steal
|
||||
#define talloc_steal _notmuch_talloc_steal
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L || __cppcheck__
|
||||
#define NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define NODISCARD /**/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue