Reapply "[libc] build with -Werror (#73966)" (#74506)

This reverts commit 6886a52d6d.

Most of the errors observed in postsubmit have been addressed. We can
fix-forward the remaining ones.

Link: https://lab.llvm.org/buildbot/#/changes/117129
This commit is contained in:
Nick Desaulniers
2024-01-08 09:07:35 -08:00
committed by GitHub
parent c68a9d25e9
commit c52b467875
2 changed files with 12 additions and 0 deletions

View File

@@ -43,6 +43,10 @@ function(_get_common_compile_options output_var flags)
list(APPEND compile_options "-fno-rtti")
list(APPEND compile_options "-Wall")
list(APPEND compile_options "-Wextra")
# -DLIBC_WNO_ERROR=ON if you can't build cleanly with -Werror.
if(NOT LIBC_WNO_ERROR)
list(APPEND compile_options "-Werror")
endif()
list(APPEND compile_options "-Wconversion")
list(APPEND compile_options "-Wno-sign-conversion")
list(APPEND compile_options "-Wimplicit-fallthrough")

View File

@@ -178,3 +178,11 @@ these functions do not call the constructors and destructors of the
allocated/deallocated objects. So, use these functions carefully and only
when it is absolutely clear that constructor and destructor invocation is
not required.
Warnings in sources
===================
We expect contributions to be free of warnings from the `minimum supported
compiler versions`__ (and newer).
.. __: https://libc.llvm.org/compiler_support.html#minimum-supported-versions