Fix warnings reported by clang
stringprintf.cc:38:1: warning: control may reach end of non-void function [-Wreturn-type]
Replace assert(false), which will only abort if NDEBUG is not set,
with abort() to uncondtionally abort.
value.cc:47:7: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
While this _should_ never be null, DebugString() is useful to debug
cases where a Value pointer is accidentally null. Keep the existing
behavior by casting the non-null 'this' pointer to a const Value*.
Change-Id: Ie905300917caf4ddeeaecff9e213c341aaf019b9
diff --git a/value.cc b/value.cc
index f5a9615..41a8adc 100644
--- a/value.cc
+++ b/value.cc
@@ -44,7 +44,7 @@
}
string Value::DebugString() const {
- if (this) {
+ if (static_cast<const Value*>(this)) {
return NoLineBreak(DebugString_());
}
return "(null)";