quickfast icon indicating copy to clipboard operation
quickfast copied to clipboard

reinterpret_cast discards const in StringBuffer.h

Open GoogleCodeExporter opened this issue 10 years ago • 1 comments

Got an error when compiling with clang because a reinterpret_cast was 
discarding the const modifier in StringBuffer.h

Here's the patch that corrects the issue:

diff --git a/src/external/quickfast/Common/StringBuffer.h 
b/src/external/quickfast/Common/StringBuffer.h
index 1f48568..0b4269d 100644
--- a/src/external/quickfast/Common/StringBuffer.h
+++ b/src/external/quickfast/Common/StringBuffer.h
@@ -101,7 +101,7 @@ namespace QuickFAST
       , growCount_(0)
       , delegateString_(0)
     {
-      assign(rhs, std::strlen(reinterpret_cast<char *>(rhs)));
+      assign(rhs, std::strlen(reinterpret_cast<const char *>(rhs)));
     }

     /// @brief Construct from a C style null terminated string

Original issue reported on code.google.com by [email protected] on 26 Aug 2012 at 5:02

GoogleCodeExporter avatar Apr 21 '15 11:04 GoogleCodeExporter

Original comment by [email protected] on 21 Jan 2013 at 4:30

  • Changed state: Accepted

GoogleCodeExporter avatar Apr 21 '15 11:04 GoogleCodeExporter