-Wc99-designators warns for the use of nested and array initializers in
C++20 code. Many internal projects have pushed back against this
warning.
Disables:
- -Wimplicit-int-float-conversion
- -Wpointer-compare
- -Wxor-used-as-pow
- -Wfinal-dtor-non-final-class
- -Wreorder-init-list
For projects under external/, vendor/, etc, but only if they use
Android.bp (not Android.mk) and -Wreorder-init-list may be re-enabled by
-Wall if set locally.
-Wno-incomplete-setjmp-declaration is needed for NDK stubs that get
generated (functions without full definitions of their parameters).
Sets
- -Wno-error=implicit-int-float-conversion
- -Wno-error=reorder-init-list
for all projects in order to unblock landing the compiler upgrade due to
internal projects not being able to disable or fix these before the
upgrade.
Bug: 139945549
Test: build (aosp_crosshatch, crosshatch, aosp_x86_64-eng,
walleye), boot internal devices, bionic + RS atests, kernel builds.
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I18e3c0eb657fd59824526f36c6dd57bdcf0526ba
Some of the warnings are too common to fix/opt-out for non-Google
projects.
Also in the change, minor clean up of duplicated code.
Test: presubmit
Bug: 139945549
Change-Id: Ic176ef1f17133405851a79592b6bef5ccb403bd9
-Wthread-safety-negative was disabled because it requires locks to
support an operator!(), and std::mutex in libc++ does not. Disabling
it everywhere was preventing it being used for modules that want to
opt in to using it and provide their own lock that supports
operator!(). Modules that use -Weverything should either stop using
-Weverything (preferred), or add -Wno-thread-safety-negative.
Bug: 143713277
Test: m native
Change-Id: I0b84679a806a21b16cabe7f739fde61c3efe2cbe
The compiler upgrade to r370808 can now check C code for implicit
fallthrough. This is triggering a massive number of warnings throughout
external/ and the rest of the platform.
Revisit enabling this for C another day.
Bug: 139945549
Test: m
Change-Id: I8dfaedab78c6230b46e8a45a9e65106dec363380
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
This was unnecessary in the past, when -nodefaultlibs was used while
linking, but that changed with
aosp/I722bd6596a1f3f5819f2767c29c0fa1e8b3ec0e8.
Test: simpleperf_ndk64.exe no longer depends on libgcc_s_seh-1.dll.
Change-Id: I435d7302906eb3758e758b5aefca8763bfba6290
hidl/aidl actually does concern about this warning. After fixing their
codebase, this flag is no longer needed.
Test: presubmit
Change-Id: Id88abea88137be0f873c21db76644fe78b9045c8
Recently, we started deferring to clang for some of its built-in
FORTIFY-like warnings. We should always treat these as errors, since
they represent potential security vulnerabilities.
Bug: 131861088
Test: m. Also made a compilation in Bionic fail; verified the build
command had -Werror=fortify-source in it.
Change-Id: I2715ea411ef067f801534dab4d306fef5431f290
The vendor variants of libprotobuf-cpp have their version numbers
included in their names, so the SONAME field is different. Whitelist
the 'lite' and 'full' versions to have different core and vendor
variants.
Test: Build a device with TARGET_VNDK_USE_CORE_VARIANT set.
Change-Id: I9880a5d7172a9f35f304af8e7dcababdcbc2ca23
Clang is smarter at producing this new warning now, producing far
fewer false positives. Re-enable the diagnostic for Android.
Test: build
Bug: 72331526
Change-Id: Ide827791c51587bceb977ae4116894a8cd620eb1
Clang is smarter at producing this new warning now, producing far
fewer false positives. Re-enable the diagnostic for Android.
Test: build
Bug: 72331526
Change-Id: I2020b887fbeb3cd833462e50df835a6cd104920d
Instead of just making this an error when building for the device, also
turn on this error for host builds. This is more important as we begin
to use remote caches during the build.
Test: treehugger
Change-Id: I6fcc945464032d951729aead540ea77850c88c41
Adds the cc_fuzz target via a cc_fuzz module. Also implements the
libclang runtime interface for the x86 toolchain to allow host-built
fuzzers.
Bug: 133261679
Bug: 137398545
Test: Build a fuzzer (with all topic patches), notice that you now
have a host-built fuzzer :)
Change-Id: I7fa069603415f40b3f12a002c253fca6e2aa1988
Library components can enable the flags based on
performance impact
Test: run-test gtest
Change-Id: I41c4464cffd2b0e830d4ab1c5a25b378e2a25129
Signed-off-by: jaishank <jaishankar.rajendran@intel.com>
For walleye, the overall binary size is decreased by ~1.1%.
For Googlers, http://go/android-llvm-newpm
Test: build
Bug: 131855431
Change-Id: I6726cd3de0d528b773fb23eae1a7c5c360e29807