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
{{ message }}
Repository navigation
Compilation warnings in opencv4/opencv2/core/types.hpp #16336
OpenCV = 4.2.0 compiled from source, and installed in /usr/local/
Operating System / Platform = Linux - debian Buster
Compiler = g++ 8.3.0
Detailed description
A compile warning error pop-ups in the core/types.hpp file
when using -Wdouble-promotion gcc compilation flag.
usr/local/include/opencv4/opencv2/core/types.hpp:1419:88: required from here
/usr/local/include/opencv4/opencv2/core/types.hpp:1218:21: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
return (double)x*pt.x + (double)y*pt.y;
~~~~~~~~~^~~~~
/usr/local/include/opencv4/opencv2/core/types.hpp:1218:38: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
return (double)x*pt.x + (double)y*pt.y;
How to reproduce
Just compile the following file:
#include <opencv2/core/types.hpp>
int main(void)
{
return 0;
}
with : g++ -Wall -Wdouble-promotion -o test test.cc -I/usr/local/include/opencv4/
How to fix
The problem is in the ddot template inside core/types.hpp line 1216.
Code should be changed to:
Activity
gapry commentedon Jan 31, 2020
Dear @bduclaux
I've made a PR #16474 to fix the issue. Please review it.
Thanks.
bduclaux commentedon Jan 31, 2020
@gapry Looks great!
Thanks !
Fixed Compilation warnings | Issue opencv#16336