Skip to content

Commit

Permalink
pw_rpc: Update ifdef guard for assert for Andestech RISC-V GCC12.2.0
Browse files Browse the repository at this point in the history
Andestech RISC-V GCC compilers continue to have a problem
with static_assert(). So, update the ifdef guard for the
new GCC12.2.0 compiler from Andestech.

Bug: b/285367496

No-Docs-Update-Reason: internal cleanups
Enhancing existing workaround for compiler limitation.

Change-Id: Icd07fb172f13170b4b48e3480916160c42b9b9bb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/250912
Reviewed-by: Ted Pudlik <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Docs-Not-Needed: Aneesh V <[email protected]>
Lint: Lint 🤖 <[email protected]>
Pigweed-Auto-Submit: Aneesh V <[email protected]>
  • Loading branch information
Aneesh V authored and CQ Bot Account committed Dec 2, 2024
1 parent 74663b2 commit 9c46a25
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pw_rpc/public/pw_rpc/internal/method_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,19 @@ class MethodLookup {
static constexpr const auto& GetMethodUnion() {
constexpr auto method = GetMethodUnionPointer<Service>(kMethodId);
// TODO: b/285367496 - Remove this #ifndef guard when the static assert
// compiles correctly when using the Andestech RISC-V GCC 10.3.0 toolchain.
#if !(defined(__riscv) && defined(__nds_v5) && (__GNUC__ == 10) && \
(__GNUC_MINOR__ == 3) && (__GNUC_PATCHLEVEL__ == 0))
// compiles correctly when using the Andestech RISC-V GCC 10.3.0 and
// 12.2.0 toolchains.
#if !(defined(__riscv) && defined(__nds_v5) && \
(((__GNUC__ == 10) && (__GNUC_MINOR__ == 3) && \
(__GNUC_PATCHLEVEL__ == 0)) || \
((__GNUC__ == 12) && (__GNUC_MINOR__ == 2) && \
(__GNUC_PATCHLEVEL__ == 0))))
static_assert(method != nullptr,
"The selected function is not an RPC service method");
#endif // !(defined(__riscv) && defined(__nds_v5) && (__GNUC__ == 10)
// && (__GNUC_MINOR__ == 3) && (__GNUC_PATCHLEVEL__ == 0))
#endif // !(defined(__riscv) && defined(__nds_v5) && (((__GNUC__ == 10) &&
// (__GNUC_MINOR__ == 3) && (__GNUC_PATCHLEVEL__ == 0)) || ((__GNUC__ ==
// 12) && (__GNUC_MINOR__ == 2) && (__GNUC_PATCHLEVEL__ == 0))))

return *method;
}

Expand Down

0 comments on commit 9c46a25

Please sign in to comment.