Index: include/log4cxx/helpers/objectptr.h
===================================================================
--- include/log4cxx/helpers/objectptr.h	(revision 438902)
+++ include/log4cxx/helpers/objectptr.h	(working copy)
@@ -133,7 +133,7 @@
                T* newPtr = 0;
                if (p1 != 0)
                {
-                  newPtr = (T*)p1->cast(T::getStaticClass());
+                  newPtr = reinterpret_cast<T*>(const_cast<void*>(p1->cast(T::getStaticClass())));
                }
                operator=(newPtr);
             }
