diff options
author | Wyatt Hepler <hepler@google.com> | 2023-03-04 03:00:03 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-03-04 03:00:03 +0000 |
commit | 962a0df16ed3b2807317db1da3b910a073f77a0a (patch) | |
tree | b69a18b868337ac382ec314b98f390d736d2a058 /pw_trace | |
parent | 9d2776bed6deb59b596d689615e0d31e9ca2d6eb (diff) | |
download | pigweed-962a0df16ed3b2807317db1da3b910a073f77a0a.tar.gz |
build: Fix compilation warnings for GCC 12
- Remove unnecessary nullptr test that triggered -Waddress.
- Initialize test buffers before they're used.
- Use unique names for the trace_id variable to avoid shadowing.
Bug: b/271485754
Change-Id: Iaac18f7a82fae70623b0af0cdd4a1691f47334b2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/132030
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Diffstat (limited to 'pw_trace')
-rw-r--r-- | pw_trace/public/pw_trace/internal/trace_internal.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pw_trace/public/pw_trace/internal/trace_internal.h b/pw_trace/public/pw_trace/internal/trace_internal.h index fc106b80c..982765f99 100644 --- a/pw_trace/public/pw_trace/internal/trace_internal.h +++ b/pw_trace/public/pw_trace/internal/trace_internal.h @@ -242,8 +242,10 @@ static inline void _pw_trace_disabled(int x, ...) { (void)x; } object_name(object_name&&) = delete; \ object_name& operator=(const object_name&) = delete; \ object_name& operator=(object_name&&) = delete; \ - object_name(uint32_t trace_id = PW_TRACE_TRACE_ID_DEFAULT) \ - : trace_id_(trace_id) { \ + \ + object_name(uint32_t PW_CONCAT(object_name, \ + _trace_id) = PW_TRACE_TRACE_ID_DEFAULT) \ + : trace_id_(PW_CONCAT(object_name, _trace_id)) { \ _PW_TRACE_IF_ENABLED(event_type_start, flag, label, group, trace_id_); \ } \ ~object_name() { \ |