Commit e5e66f13 authored by Kenton Varda's avatar Kenton Varda

Warning-related tweaks.

parent d60914ca
...@@ -48,7 +48,7 @@ inline T& operator<<(T& os, Void) { return os << "void"; } ...@@ -48,7 +48,7 @@ inline T& operator<<(T& os, Void) { return os << "void"; }
using kj::byte; using kj::byte;
class word { uint64_t content KJ_UNUSED_FOR_CLANG; KJ_DISALLOW_COPY(word); public: word() = default; }; class word { uint64_t content KJ_UNUSED_MEMBER; KJ_DISALLOW_COPY(word); public: word() = default; };
// word is an opaque type with size of 64 bits. This type is useful only to make pointer // word is an opaque type with size of 64 bits. This type is useful only to make pointer
// arithmetic clearer. Since the contents are private, the only way to access them is to first // arithmetic clearer. Since the contents are private, the only way to access them is to first
// reinterpret_cast to some other pointer type. // reinterpret_cast to some other pointer type.
......
...@@ -104,11 +104,11 @@ typedef unsigned char byte; ...@@ -104,11 +104,11 @@ typedef unsigned char byte;
#define KJ_UNUSED __attribute__((unused)); #define KJ_UNUSED __attribute__((unused));
#if __clang__ #if __clang__
#define KJ_UNUSED_FOR_CLANG __attribute__((unused)); #define KJ_UNUSED_MEMBER __attribute__((unused));
// Clang reports "unused" warnings in some places where GCC does not even allow the "unused" // Inhibits "unused" warning for member variables. Only Clang produces such a warning, while GCC
// attribute. // complains if the attribute is set on members.
#else #else
#define KJ_UNUSED_FOR_CLANG #define KJ_UNUSED_MEMBER
#endif #endif
namespace internal { namespace internal {
......
...@@ -44,7 +44,7 @@ String getStackSymbols(ArrayPtr<void* const> trace) { ...@@ -44,7 +44,7 @@ String getStackSymbols(ArrayPtr<void* const> trace) {
char exe[512]; char exe[512];
ssize_t n = readlink("/proc/self/exe", exe, sizeof(exe)); ssize_t n = readlink("/proc/self/exe", exe, sizeof(exe));
if (n < 0 || n >= sizeof(exe)) { if (n < 0 || n >= static_cast<ssize_t>(sizeof(exe))) {
return nullptr; return nullptr;
} }
exe[n] = '\0'; exe[n] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment