Skip to content

Commit

Permalink
Fix compiler warning [-Wtautological-undefined-compare]
Browse files Browse the repository at this point in the history
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 <sw@weilnetz.de>
  • Loading branch information
stweil committed Jul 4, 2018
1 parent 52d392d commit c1be102
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lstm/networkio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_) {
Expand Down

0 comments on commit c1be102

Please sign in to comment.