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
Compilation warnings are annoying. PaddlePaddle used to suffer from many warnings of "comparing signed and unsigned integers". These warnings make it hard to go over the build log and find out errors. We tried hard to fix warnings; it was a hard work. Recently, we see warnings again. With the growing of contributors, the trend is clear.
I propose to add the compiler flag -Werror, which considers warnings and errors, and
we'd only want to apply this to PaddlePaddle's code, but not its dependents built using CMake.
Add -Werror to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS. This would apply -Werror to PaddlePaddle.
Define PADDLE_DEPS_CXX_FLAGS and PADDLE_DEPS_C_FLAGS, which don't include -Werror.
Edit /cmake/external/*.cmake, add set the CMAKE_CXX_FLAGS and CMAKE_C_FLAGS variables of these dependents to be the value of PADDLE_DEPS_CXX_FLAGS and PADDLE_DEPS_C_FLAGS.
For example:
Compilation warnings are annoying. PaddlePaddle used to suffer from many warnings of "comparing signed and unsigned integers". These warnings make it hard to go over the build log and find out errors. We tried hard to fix warnings; it was a hard work. Recently, we see warnings again. With the growing of contributors, the trend is clear.
-Werror
, which considers warnings and errors, andThanks to @gangliao who pointed the solution
Add
-Werror
toCMAKE_CXX_FLAGS
andCMAKE_C_FLAGS
. This would apply-Werror
to PaddlePaddle.Define
PADDLE_DEPS_CXX_FLAGS
andPADDLE_DEPS_C_FLAGS
, which don't include-Werror
.Edit
/cmake/external/*.cmake
, add set theCMAKE_CXX_FLAGS
andCMAKE_C_FLAGS
variables of these dependents to be the value ofPADDLE_DEPS_CXX_FLAGS
andPADDLE_DEPS_C_FLAGS
.For example:
The text was updated successfully, but these errors were encountered: