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"; }
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
// arithmetic clearer. Since the contents are private, the only way to access them is to first
// reinterpret_cast to some other pointer type.
......
......@@ -104,11 +104,11 @@ typedef unsigned char byte;
#define KJ_UNUSED __attribute__((unused));
#if __clang__
#define KJ_UNUSED_FOR_CLANG __attribute__((unused));
// Clang reports "unused" warnings in some places where GCC does not even allow the "unused"
// attribute.
#define KJ_UNUSED_MEMBER __attribute__((unused));
// Inhibits "unused" warning for member variables. Only Clang produces such a warning, while GCC
// complains if the attribute is set on members.
#else
#define KJ_UNUSED_FOR_CLANG
#define KJ_UNUSED_MEMBER
#endif
namespace internal {
......
......@@ -44,7 +44,7 @@ String getStackSymbols(ArrayPtr<void* const> trace) {
char exe[512];
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;
}
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