Project

Profile

Help

Bug #2652

closed

cast from ‘jobject {aka __jobject*}’ to ‘jint {aka int}’ loses precision [-fpermissive]

Added by O'Neil Delpratt over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
C++ API
Start date:
2016-02-26
Due date:
% Done:

100%

Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
1.0.0
Fixed in version:
1.0.1
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

Description

On some 64-bit linux machine the following error occurs when building Saxon/C on C++:

../../Saxon.C.API/XdmNode.cpp: In member function ‘int XdmNode::getAttributeCount()’:
../../Saxon.C.API/XdmNode.cpp:205:19: error: cast from ‘jobject {aka __jobject*}’ to ‘jint {aka int}’ loses precision [-fpermissive]
   value->xdmvalue));

A workaround is to cast the lines affected to jlong first. See below:

jint result = (jlong)(proc->environ->env->CallStaticObjectMethod(xdmUtilsClass, xmID, value->xdmvalue));

A fix has been committed to subversion to the XdmNode.cpp file where we cast the value to jlong and then to jint.

Please register to edit this issue

Also available in: Atom PDF