pw_preprocessor: Remove uses of the PW_UNUSED macro

- PW_UNUSED provides no value over the [[maybe_unused]] C++ attribute or
  a simple void cast. Replace uses of it and mark the macro as
  deprecated.
- Add a section to the Embedded C++ Guide about compiler warnings,
  including how to silence -Wunused-* warnings.

Change-Id: I078be670465ed87733f7c6d1f3d327915a0f49f6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/32122
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
diff --git a/pw_metric/global_test.cc b/pw_metric/global_test.cc
index ab0aab5..d918c79 100644
--- a/pw_metric/global_test.cc
+++ b/pw_metric/global_test.cc
@@ -21,24 +21,13 @@
 namespace pw {
 namespace metric {
 
-// Count elements in an iterable.
-template <typename T>
-int Size(T& container) {
-  int num_elements = 0;
-  for (auto& element : container) {
-    PW_UNUSED(element);
-    num_elements++;
-  }
-  return num_elements;
-}
-
 // Create two global metrics; make sure they show up.
 PW_METRIC_GLOBAL(stat_x, "stat_x", 123u);
 PW_METRIC_GLOBAL(stat_y, "stat_y", 123u);
 
 TEST(Global, Metrics) {
   Metric::Dump(global_metrics);
-  EXPECT_EQ(Size(global_metrics), 2);
+  EXPECT_EQ(global_metrics.size(), 2u);
 }
 
 // Create three global metric groups; make sure they show up.
@@ -57,11 +46,11 @@
 
 TEST(Global, Groups) {
   Group::Dump(global_groups);
-  EXPECT_EQ(Size(global_groups), 4);
+  EXPECT_EQ(global_groups.size(), 4u);
 
-  EXPECT_EQ(Size(gyro_metrics.metrics()), 1);
-  EXPECT_EQ(Size(comms_metrics.metrics()), 2);
-  EXPECT_EQ(Size(power_metrics.metrics()), 3);
+  EXPECT_EQ(gyro_metrics.metrics().size(), 1u);
+  EXPECT_EQ(comms_metrics.metrics().size(), 2u);
+  EXPECT_EQ(power_metrics.metrics().size(), 3u);
 }
 
 }  // namespace metric