[PATCH] Turn off missing field initializer warnings for gcc
Chandler Carruth
chandlerc at google.com
Thu Jan 31 09:59:28 PST 2013
LGTM
On Thu, Jan 31, 2013 at 9:56 AM, Edwin Vane <edwin.vane at intel.com> wrote:
> - Adding check_cxx_compiler_flag test.
>
> Hi gribozavr, dblaikie,
>
> http://llvm-reviews.chandlerc.com/D358
>
> CHANGE SINCE LAST DIFF
> http://llvm-reviews.chandlerc.com/D358?vs=846&id=848#toc
>
> Files:
> cmake/modules/HandleLLVMOptions.cmake
>
> Index: cmake/modules/HandleLLVMOptions.cmake
> ===================================================================
> --- cmake/modules/HandleLLVMOptions.cmake
> +++ cmake/modules/HandleLLVMOptions.cmake
> @@ -178,6 +178,19 @@
> elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
> if (LLVM_ENABLE_WARNINGS)
> add_llvm_definitions( -Wall -W -Wno-unused-parameter -Wwrite-strings )
> +
> + # Turn off missing field initializer warnings for gcc to avoid noise
> from
> + # false positives with empty {}. Turn them on otherwise (they're off
> by
> + # default for clang).
> + check_cxx_compiler_flag("-Wmissing-field-initializers"
> CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG)
> + if (CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG)
> + if (CMAKE_COMPILER_IS_GNUCXX)
> + add_llvm_definitions( -Wno-missing-field-initializers )
> + else()
> + add_llvm_definitions( -Wmissing-field-initializers )
> + endif()
> + endif()
> +
> if (LLVM_ENABLE_PEDANTIC)
> add_llvm_definitions( -pedantic -Wno-long-long )
> endif (LLVM_ENABLE_PEDANTIC)
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130131/c3730b32/attachment.html>
More information about the cfe-commits
mailing list