diff options
author | jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-04-20 15:56:32 +0000 |
---|---|---|
committer | jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-04-20 15:56:32 +0000 |
commit | 089003b7f67758da12b5b8f2c97b4e306259b65e (patch) | |
tree | a3c166d5088007f1cb5bb8efee5c8f553d15b064 | |
parent | Breakpad stack walker: remove embedded newlines from module names. (diff) | |
download | breakpad-089003b7f67758da12b5b8f2c97b4e306259b65e.tar.xz |
Breakpad processor: Work around overload resolution problems in stream pos_type comparisons
When building with G++ 4.1.2, src/processor/cfi_frame_info.cc fails to
build with the error below. G++ 4.2.1 and later do not seem to report this
problem.
This patch works around the problem by casting stream.tellp() to
std::streamoff before doing the comparison.
src/processor/cfi_frame_info.cc: In member function `std::string google_breakpad::CFIFrameInfo::Serialize() const':
src/processor/cfi_frame_info.cc:105: error: ambiguous overload for `operator!=' in `stream.std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::<anonymous>.std::basic_ostream<_CharT, _Traits>::tellp [with _CharT = char, _Traits = std::char_traits<char>]() != 0'
src/processor/cfi_frame_info.cc:105: note: candidates are: operator!=(std::streamoff, int) <built-in>
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/postypes.h:143: note: bool std::fpos<_StateT>::operator!=(const std::fpos<_StateT>&) const [with _StateT = __mbstate_t]
a=jimblandy, r=mmentovai
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@572 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r-- | src/processor/cfi_frame_info.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/processor/cfi_frame_info.cc b/src/processor/cfi_frame_info.cc index 668bdeb8..135eee21 100644 --- a/src/processor/cfi_frame_info.cc +++ b/src/processor/cfi_frame_info.cc @@ -102,14 +102,14 @@ string CFIFrameInfo::Serialize() const { stream << ".cfa: " << cfa_rule_; } if (!ra_rule_.empty()) { - if (stream.tellp() != 0) + if (static_cast<std::streamoff>(stream.tellp()) != 0) stream << " "; stream << ".ra: " << ra_rule_; } for (RuleMap::const_iterator iter = register_rules_.begin(); iter != register_rules_.end(); ++iter) { - if (stream.tellp() != 0) + if (static_cast<std::streamoff>(stream.tellp()) != 0) stream << " "; stream << iter->first << ": " << iter->second; } |