diff options
author | 2025-01-15 03:11:20 +0000 | |
---|---|---|
committer | 2025-01-21 22:32:25 +0000 | |
commit | 202895c759b6ab03e27c1e349e46cd30c8469144 (patch) | |
tree | b8b59d8024bbad66a74be425dc4a354d5a06d98a | |
parent | 52b4e75352b247ed97af76972579a2b472d07f73 (diff) |
trusty: Don't generate errors for new lints in clang/LLVM 19
clang/LLVM 19 triggers a new lint (-Wunused-but-set-variable) when
building Parcel.cpp for Trusty because `BINDER_WITH_KERNEL_IPC` is not
defined. Trusty neededs to roll to clang 19 to match the version of
LLVM used to build Rust 1.82.
The lints are raised because some variables are set but unused whenever
BINDER_WITH_KERNEL_IPC is undefined. Since the lints are not surfacing
actual problems, silence them by adding no-op uses.
Bug: 390243478
Test: Treehugger
Test: build Trusty with prebuilt clang-r536225
Change-Id: Ib45a21b79ca87f5467b67d0d9179cdfb2e4c0331
-rw-r--r-- | libs/binder/Parcel.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index a97d111b97..65c6553e44 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -616,6 +616,7 @@ status_t Parcel::appendFrom(const Parcel* parcel, size_t offset, size_t len) { } #else LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time"); + (void)kernelFields; return INVALID_OPERATION; #endif // BINDER_WITH_KERNEL_IPC } else { @@ -797,6 +798,7 @@ std::vector<int> Parcel::debugReadAllFileDescriptors() const { setDataPosition(initPosition); #else LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time"); + (void)kernelFields; #endif } else if (const auto* rpcFields = maybeRpcFields(); rpcFields && rpcFields->mFds) { for (const auto& fd : *rpcFields->mFds) { @@ -839,9 +841,10 @@ status_t Parcel::hasBindersInRange(size_t offset, size_t len, bool* result) cons } #else LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time"); + (void)kernelFields; return INVALID_OPERATION; #endif // BINDER_WITH_KERNEL_IPC - } else if (const auto* rpcFields = maybeRpcFields()) { + } else if (maybeRpcFields()) { return INVALID_OPERATION; } return NO_ERROR; @@ -879,6 +882,7 @@ status_t Parcel::hasFileDescriptorsInRange(size_t offset, size_t len, bool* resu } #else LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time"); + (void)kernelFields; return INVALID_OPERATION; #endif // BINDER_WITH_KERNEL_IPC } else if (const auto* rpcFields = maybeRpcFields()) { @@ -971,6 +975,7 @@ status_t Parcel::writeInterfaceToken(const char16_t* str, size_t len) { writeInt32(kHeader); #else // BINDER_WITH_KERNEL_IPC LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time"); + (void)kernelFields; return INVALID_OPERATION; #endif // BINDER_WITH_KERNEL_IPC } @@ -1061,6 +1066,7 @@ bool Parcel::enforceInterface(const char16_t* interface, #else // BINDER_WITH_KERNEL_IPC LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time"); (void)threadState; + (void)kernelFields; return false; #endif // BINDER_WITH_KERNEL_IPC } @@ -2690,6 +2696,7 @@ void Parcel::closeFileDescriptors() { } #else // BINDER_WITH_KERNEL_IPC LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time"); + (void)kernelFields; #endif // BINDER_WITH_KERNEL_IPC } else if (auto* rpcFields = maybeRpcFields()) { rpcFields->mFds.reset(); |