zhangjl / google-glog

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

Compilation errors when using -DNDEBUG flag while compiling #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Prepare a C++ file that includes glog/logging.h and uses the CHECK()
   macro.
2. Compile the C++ using -DNDEBUG flag.

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

The file should compile. Instead there are a lot of errors seen
that complain about GetReferenceableValue() not defined. The issue is the
following code in glog/logging.h:

// In optimized mode, use CheckOpString to hint to compiler that
// the while condition is unlikely.
#define CHECK_OP_LOG(name, op, val1, val2, log) \
  while (google::CheckOpString _result = \
         google::Check##name##Impl(GetReferenceableValue(val1), \
                           GetReferenceableValue(val2), \
                           #val1 " " #op " " #val2)) \
    log(__FILE__, __LINE__, _result).stream()
#endif  // STATIC_ANALYSIS, !NDEBUG

The above code needs to replace GetReferenceableValue with
google::GetReferenceableValue .

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

Version 0.3.0. Ubuntu 9.10.

Please provide any additional information below.

Original issue reported on code.google.com by mohit.a...@gmail.com on 5 Nov 2009 at 3:38

GoogleCodeExporter commented 9 years ago
Fixed in

http://code.google.com/p/google-glog/source/detail?r=74

Thanks for the report!

Original comment by shinichi...@gmail.com on 11 Nov 2009 at 9:10

GoogleCodeExporter commented 9 years ago
Issue 37 has been merged into this issue.

Original comment by shinichi...@gmail.com on 15 Feb 2010 at 7:21