pangyuteng / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

DCHECK_NOTNULL cause warning #87

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. using in function scope: DCHECK_NOTNULL(ptr); // expect as assert(ptr != 
NULL);
2. gcc warning: statement has no effect

What is the expected output? What do you see instead?
nothing warning

What version of the product are you using? On what operating system?
0.3.1

Please provide any additional information below.

DCHECK_NOTNULL may be defined as following:

// A small helper for CHECK_NOTNULL().
template <typename T>
inline T* NotDebugCheckNotNull(T* t) {
  return t;
}

#define DCHECK_NOTNULL(val) NotDebugCheckNotNull(val)

Original issue reported on code.google.com by chen3feng on 20 Apr 2011 at 11:54