Skip to content

Commit 202895c

Browse files
author
Per Larsen
committed
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
1 parent 52b4e75 commit 202895c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

libs/binder/Parcel.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ status_t Parcel::appendFrom(const Parcel* parcel, size_t offset, size_t len) {
616616
}
617617
#else
618618
LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time");
619+
(void)kernelFields;
619620
return INVALID_OPERATION;
620621
#endif // BINDER_WITH_KERNEL_IPC
621622
} else {
@@ -797,6 +798,7 @@ std::vector<int> Parcel::debugReadAllFileDescriptors() const {
797798
setDataPosition(initPosition);
798799
#else
799800
LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time");
801+
(void)kernelFields;
800802
#endif
801803
} else if (const auto* rpcFields = maybeRpcFields(); rpcFields && rpcFields->mFds) {
802804
for (const auto& fd : *rpcFields->mFds) {
@@ -839,9 +841,10 @@ status_t Parcel::hasBindersInRange(size_t offset, size_t len, bool* result) cons
839841
}
840842
#else
841843
LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time");
844+
(void)kernelFields;
842845
return INVALID_OPERATION;
843846
#endif // BINDER_WITH_KERNEL_IPC
844-
} else if (const auto* rpcFields = maybeRpcFields()) {
847+
} else if (maybeRpcFields()) {
845848
return INVALID_OPERATION;
846849
}
847850
return NO_ERROR;
@@ -879,6 +882,7 @@ status_t Parcel::hasFileDescriptorsInRange(size_t offset, size_t len, bool* resu
879882
}
880883
#else
881884
LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time");
885+
(void)kernelFields;
882886
return INVALID_OPERATION;
883887
#endif // BINDER_WITH_KERNEL_IPC
884888
} else if (const auto* rpcFields = maybeRpcFields()) {
@@ -971,6 +975,7 @@ status_t Parcel::writeInterfaceToken(const char16_t* str, size_t len) {
971975
writeInt32(kHeader);
972976
#else // BINDER_WITH_KERNEL_IPC
973977
LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time");
978+
(void)kernelFields;
974979
return INVALID_OPERATION;
975980
#endif // BINDER_WITH_KERNEL_IPC
976981
}
@@ -1061,6 +1066,7 @@ bool Parcel::enforceInterface(const char16_t* interface,
10611066
#else // BINDER_WITH_KERNEL_IPC
10621067
LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time");
10631068
(void)threadState;
1069+
(void)kernelFields;
10641070
return false;
10651071
#endif // BINDER_WITH_KERNEL_IPC
10661072
}
@@ -2690,6 +2696,7 @@ void Parcel::closeFileDescriptors() {
26902696
}
26912697
#else // BINDER_WITH_KERNEL_IPC
26922698
LOG_ALWAYS_FATAL("Binder kernel driver disabled at build time");
2699+
(void)kernelFields;
26932700
#endif // BINDER_WITH_KERNEL_IPC
26942701
} else if (auto* rpcFields = maybeRpcFields()) {
26952702
rpcFields->mFds.reset();

0 commit comments

Comments
 (0)