Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rgoulter/18ea3157d684c99d6a53 to your computer and use it in GitHub Desktop.
Save rgoulter/18ea3157d684c99d6a53 to your computer and use it in GitHub Desktop.
[ 98%] Building CXX object tools/cling/lib/Interpreter/CMakeFiles/clingInterpreter.dir/ValuePrinter.cpp.obj
In file included from C:\Users\richa_000\cling-build\src\tools\cling\lib\Interpreter\ValuePrinter.cpp:10:0:
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h: In instantiation of 'static T cling::Value::CastFwd<T>::cast(const cling::Value&) [with
T = long double]':
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:209:36: required from 'T cling::Value::simplisticCastAs() const [with T = long double]'
C:\Users\richa_000\cling-build\src\tools\cling\lib\Interpreter\ValuePrinter.cpp:213:48: required from here
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:104:53: error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
return (T) (unsigned long) V.getAs<void*>();
^
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h: In instantiation of 'static T cling::Value::CastFwd<T>::cast(const cling::Value&) [with
T = double]':
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:209:36: required from 'T cling::Value::simplisticCastAs() const [with T = double]'
C:\Users\richa_000\cling-build\src\tools\cling\lib\Interpreter\ValuePrinter.cpp:231:44: required from here
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:104:53: error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h: In instantiation of 'static T cling::Value::CastFwd<T>::cast(const cling::Value&) [with
T = long long int]':
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:209:36: required from 'T cling::Value::simplisticCastAs() const [with T = long long int]'
C:\Users\richa_000\cling-build\src\tools\cling\lib\Interpreter\ValuePrinter.cpp:234:49: required from here
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:104:53: error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h: In instantiation of 'static T cling::Value::CastFwd<T>::cast(const cling::Value&) [with
T = long long unsigned int]':
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:209:36: required from 'T cling::Value::simplisticCastAs() const [with T = long long unsigned int]'
C:\Users\richa_000\cling-build\src\tools\cling\lib\Interpreter\ValuePrinter.cpp:236:58: required from here
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:104:53: error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h: In instantiation of 'static T cling::Value::CastFwd<T>::cast(const cling::Value&) [with
T = bool]':
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:209:36: required from 'T cling::Value::simplisticCastAs() const [with T = bool]'
C:\Users\richa_000\cling-build\src\tools\cling\lib\Interpreter\ValuePrinter.cpp:238:43: required from here
C:/Users/richa_000/cling-build/src/tools/cling/include/cling/Interpreter/Value.h:104:53: error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
tools\cling\lib\Interpreter\CMakeFiles\clingInterpreter.dir\build.make:688: recipe for target 'tools/cling/lib/Interpreter/CMakeFiles/clingInterpreter.dir/ValuePrinter.cpp.obj' failed
mingw32-make[2]: *** [tools/cling/lib/Interpreter/CMakeFiles/clingInterpreter.dir/ValuePrinter.cpp.obj] Error 1
CMakeFiles\Makefile2:11223: recipe for target 'tools/cling/lib/Interpreter/CMakeFiles/clingInterpreter.dir/all' failed
mingw32-make[1]: *** [tools/cling/lib/Interpreter/CMakeFiles/clingInterpreter.dir/all] Error 2
makefile:135: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
@rgoulter
Copy link
Author

rgoulter commented Dec 1, 2014

I got the same errors when trying a cross-compile from Arch Linux. :| Go figure.
This is when trying to build Cling using Mingw-w64.

@rgoulter
Copy link
Author

rgoulter commented Dec 6, 2014

    // Allow simplisticCastAs to be partially specialized.
    template<typename T>
    struct CastFwd {
      static T cast(const Value& V) {
        EStorageType storageType = V.getStorageType();
        switch (storageType) {
        case kSignedIntegerOrEnumerationType:
          return (T) V.getAs<long long>();
        case kUnsignedIntegerOrEnumerationType:
          return (T) V.getAs<unsigned long long>();
        case kDoubleType:
          return (T) V.getAs<double>();
        case kFloatType:
          return (T) V.getAs<float>();
        case kLongDoubleType:
          return (T) V.getAs<long double>();
        case kPointerType:
          return (T) (unsigned long) V.getAs<void*>();
        case kUnsupportedType:
          V.AssertOnUnsupportedTypeCast();
        }
        return T();
      }
    };

This is complaining about the cast in lines:

        case kPointerType:
          return (T) (unsigned long) V.getAs<void*>();

@martell
Copy link

martell commented Dec 8, 2014

Hi,

Include stddef.h and change both occurrences to size_t.
I'm trying to upstream a patch on this
this is why it worked in the past

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment