From 8c8a252d9fe944969ece1c567b0c12fa8718de55 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 1 Feb 2018 13:47:42 +1100 Subject: [PATCH] build: prefer nodiscard over warn_unused_result --- posix/fd.hpp | 4 ++-- signal.hpp | 4 ++-- view.hpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/posix/fd.hpp b/posix/fd.hpp index 0ece99f9..30642049 100644 --- a/posix/fd.hpp +++ b/posix/fd.hpp @@ -63,8 +63,8 @@ namespace util::posix { int release (void); //--------------------------------------------------------------------- - [[gnu::warn_unused_result]] ssize_t read (void *buf, size_t count); - [[gnu::warn_unused_result]] ssize_t write (const void *buf, size_t count); + [[nodiscard]] ssize_t read (void *buf, size_t count); + [[nodiscard]] ssize_t write (const void *buf, size_t count); //--------------------------------------------------------------------- diff --git a/signal.hpp b/signal.hpp index 88d1dd5d..d176c28b 100644 --- a/signal.hpp +++ b/signal.hpp @@ -81,8 +81,8 @@ namespace util { ~signal (); /// Add a callback to list. - cookie connect [[gnu::warn_unused_result]] (callback&&); - cookie connect [[gnu::warn_unused_result]] (const callback&); + cookie connect [[nodiscard]] (callback&&); + cookie connect [[nodiscard]] (const callback&); void disconnect (cookie&); diff --git a/view.hpp b/view.hpp index 7939076c..6f780c6a 100644 --- a/view.hpp +++ b/view.hpp @@ -288,7 +288,7 @@ namespace util { } //--------------------------------------------------------------------- - [[gnu::warn_unused_result]] constexpr auto + [[nodiscard]] constexpr auto redim (size_type count) const { assert (count > 0);