clMathLibraries / clBLAS

a software library containing BLAS functions written in OpenCL
Apache License 2.0
843 stars 237 forks source link

Disable clang error on narrowing conversions. #281

Closed IvanVergiliev closed 8 years ago

IvanVergiliev commented 8 years ago

clang with -std=c++11 fails to compile the project because there are narrowing conversions in src/library/blas/xtrsm.cc and a bunch of other files. The problem is reproducible for me if instead of

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")

I set

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

Disabling the error seems like the easiest solution. Another alternative is to add explicit casts, but it touched multiple places in the code so I figured that this is the safer path.

Also, having an explicit section with compile options for clang may save some confusion - I spent quite a bit of time wondering why my CXXFLAGS are not respected until I realized that clang is not considered a GNUCXX compiler so the first if does not apply to it.


This change is Reviewable