commit | aaac691e7363c14ead84b4ae5ea8f725a4c97488 | [log] [tgz] |
---|---|---|
author | Rob Oliver <rgoliver@google.com> | Mon Feb 28 15:59:06 2022 -0500 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Mar 02 01:46:21 2022 +0000 |
tree | b2b86d3647f41c981f7edc3511ec214a66634df4 | |
parent | a7a35fe1aee30a7fd297a3774f1a0867a562f332 [diff] |
pw_rpc: Fix lock.h from gcc bug A gcc bug in 8.4 is causing an error when parsing [[maybe_unused]] when it's the first parameter. Reordering fixes the issue. Context: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429 Change-Id: Ib6dd90e87de5dc7213ebbc5ad07105a9c7998421 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/85840 Reviewed-by: Wyatt Hepler <hepler@google.com> Commit-Queue: Rob Oliver <rgoliver@google.com>
diff --git a/pw_rpc/public/pw_rpc/internal/lock.h b/pw_rpc/public/pw_rpc/internal/lock.h index efb0443..50c53d5 100644 --- a/pw_rpc/public/pw_rpc/internal/lock.h +++ b/pw_rpc/public/pw_rpc/internal/lock.h
@@ -41,7 +41,9 @@ class PW_SCOPED_LOCKABLE LockGuard { public: - constexpr LockGuard([[maybe_unused]] RpcLock& mutex) + // [[maybe_unused]] needs to be after the parameter to workaround a gcc bug + // context: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429 + constexpr LockGuard(RpcLock& mutex [[maybe_unused]]) PW_EXCLUSIVE_LOCK_FUNCTION(mutex) {} ~LockGuard() PW_UNLOCK_FUNCTION() = default;