You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.../jni.hpp/include/jni/functions.hpp:202:73: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]
Wrap<jobject*>(env.NewObject(Unwrap(clazz), Unwrap(method), Unwrap(std::forward<Args>(args))...)));
~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../jni.hpp/include/jni/class.hpp:50:41: note: in instantiation of function template specialization 'jni::NewObject<signed char, signed char, short, short, int, int, long long, long long, float, double, unsigned char, jni::jstring *>' requested here
return Object<TagType>(&NewObject(env, *clazz, method, Untag(args)...));
This is because float is automatically promoted to double in varargs.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48379 notes that this is a pretty useless case for this warning, but still, we could suppress it by introducing a templated Vararg function that does an explicit static cast in the case of float.
The text was updated successfully, but these errors were encountered:
Currently if
-Wdouble-promotion
is enabled, then invoking methods that takefloat
parameters will trigger the warning. For example:The warning looks something like:
This is because
float
is automatically promoted todouble
in varargs.https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48379 notes that this is a pretty useless case for this warning, but still, we could suppress it by introducing a templated
Vararg
function that does an explicit static cast in the case offloat
.The text was updated successfully, but these errors were encountered: