diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-03-12 12:56:11 -0700 |
---|---|---|
committer | Rosen Penev <rosenp@gmail.com> | 2020-03-16 00:08:21 -0700 |
commit | 97425d56e7ad0ce19357b5d8984de082c0dacffc (patch) | |
tree | ceff26b07d79daa4fd2f93f2d37007f1f52de8f3 /src/util | |
parent | 0afb156a5bbb23a9602ef3b8188e82e4afe300e4 (diff) |
remove gcc_unused
[[maybe_unused]] (introduced in C++17) is standard C++.
https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/Compiler.h | 8 | ||||
-rw-r--r-- | src/util/UTF8.cxx | 2 |
2 files changed, 1 insertions, 9 deletions
diff --git a/src/util/Compiler.h b/src/util/Compiler.h index cdfcc1db0..4b7b22269 100644 --- a/src/util/Compiler.h +++ b/src/util/Compiler.h @@ -74,7 +74,6 @@ #define gcc_printf(a,b) __attribute__((format(printf, a, b))) #define gcc_pure __attribute__((pure)) #define gcc_sentinel __attribute__((sentinel)) -#define gcc_unused __attribute__((unused)) #define gcc_nonnull(...) __attribute__((nonnull(__VA_ARGS__))) #define gcc_nonnull_all __attribute__((nonnull)) @@ -101,7 +100,6 @@ #define gcc_printf(a,b) #define gcc_pure #define gcc_sentinel -#define gcc_unused #define gcc_nonnull(...) #define gcc_nonnull_all @@ -161,12 +159,6 @@ #define __has_feature(x) 0 #endif -#if __has_feature(attribute_unused_on_fields) -#define gcc_unused_field gcc_unused -#else -#define gcc_unused_field -#endif - #if defined(__GNUC__) || defined(__clang__) #define gcc_unreachable() __builtin_unreachable() #else diff --git a/src/util/UTF8.cxx b/src/util/UTF8.cxx index 9dbcb3260..608843a87 100644 --- a/src/util/UTF8.cxx +++ b/src/util/UTF8.cxx @@ -204,7 +204,7 @@ struct CheckSequenceUTF8 { template<> struct CheckSequenceUTF8<0U> { - constexpr bool operator()(gcc_unused const char *p) const noexcept { + constexpr bool operator()([[maybe_unused]] const char *p) const noexcept { return true; } }; |