ganyc717 / Darknet-On-OpenCL

Darknet On OpenCL
MIT License
101 stars 44 forks source link

compile error: data.cpp #17

Open drjasonharrison-vp-eio opened 6 years ago

drjasonharrison-vp-eio commented 6 years ago

This is on OSX, using C++17:

/Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:14: error: non-constant-expression cannot be narrowed from type 'int' to 'float' in initializer list [-Wc++11-narrowing] box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~ /Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:14: note: insert an explicit cast to silence this issue box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~ static_cast( ) /Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:20: error: non-constant-expression cannot be narrowed from type 'int' to 'float' in initializer list [-Wc++11-narrowing] box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~ /Users/harrison/Eio/Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:20: note: insert an explicit cast to silence this issue box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~ static_cast( ) /Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:26: error: non-constant-expression cannot be narrowed from type 'int' to 'float' in initializer list [-Wc++11-narrowing] box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~~ /Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:26: note: insert an explicit cast to silence this issue box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~~ static_cast( ) /Users/harrison/Eio/Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:41: error: non-constant-expression cannot be narrowed from type 'int' to 'float' in initializer list [-Wc++11-narrowing] box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~~ /Darknet-On-OpenCL/darknet_cl/src/data.cpp:359:41: note: insert an explicit cast to silence this issue box b = {minx, miny, maxx-minx + 1, maxy-miny + 1}; ^~~~~ static_cast( )