From c1be1024be77a65ff97c2f0bc0f13aea5ed5647a Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 4 Jul 2018 21:09:56 +0200 Subject: [PATCH] Fix compiler warning [-Wtautological-undefined-compare] clang warning: src/lstm/networkio.cpp:56:15: warning: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] Signed-off-by: Stefan Weil --- src/lstm/networkio.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lstm/networkio.cpp b/src/lstm/networkio.cpp index 405977e99d..88f3f4092a 100644 --- a/src/lstm/networkio.cpp +++ b/src/lstm/networkio.cpp @@ -50,10 +50,9 @@ void NetworkIO::Resize2d(bool int_mode, int width, int num_features) { // Resizes to a specific stride_map. void NetworkIO::ResizeToMap(bool int_mode, const StrideMap& stride_map, int num_features) { - // If this assert fails, it most likely got here through an uninitialized - // scratch element, ie call NetworkScratch::IO::Resizexxx() not - // NetworkIO::Resizexxx()!! - ASSERT_HOST(this != nullptr); + // If this method crashes with this == nullptr, + // it most likely got here through an uninitialized scratch element, + // ie call NetworkScratch::IO::Resizexxx() not NetworkIO::Resizexxx()!! stride_map_ = stride_map; int_mode_ = int_mode; if (int_mode_) {