From 2cfc6d53078a9a173a226a0d3269e9004fef0ba7 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 20 Apr 2017 21:01:51 -0700 Subject: [PATCH] build: add -Wshorten-64-to-32 for non-hbd builds C sources only for now BUG=aomedia:445 Change-Id: I79ff81c42778e2836028240df70edf973555018c --- build/cmake/aom_configure.cmake | 3 +++ configure | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake index 511b6c33b..1a7565ee8 100644 --- a/build/cmake/aom_configure.cmake +++ b/build/cmake/aom_configure.cmake @@ -133,6 +133,9 @@ else () add_compiler_flag_if_supported("-Wuninitialized") add_compiler_flag_if_supported("-Wunused") add_compiler_flag_if_supported("-Wvla") + if (NOT CONFIG_HIGHBITDEPTH) + add_c_flag_if_supported("-Wshorten-64-to-32") + endif () # Add -Wshadow only for C files to avoid massive gtest warning spam. add_c_flag_if_supported("-Wshadow") diff --git a/configure b/configure index 8d757cbf2..4703f3203 100755 --- a/configure +++ b/configure @@ -718,6 +718,11 @@ process_toolchain() { fi # gtest makes heavy use of undefined pre-processor symbols check_cflags "-Wundef" && add_cflags_only "-Wundef" + if ! enabled highbitdepth; then + # Avoid this warning for third_party C++ sources. Some reorganization + # would be needed to apply this only to test/*.cc. + check_cflags -Wshorten-64-to-32 && add_cflags_only -Wshorten-64-to-32 + fi fi if enabled icc; then -- GitLab