`log/internal/check_op`: Add ABSL_ATTRIBUTE_UNUSED to CHECK macros when STRIP_LOG is enabled
When `STRIP_LOG` is off, the internal variable `absl_log_internal_check_op_result` is passed to `absl::log_internal::LogMessageFatal()` and used in the failure message. When `STRIP_LOG` is on, the variable is truly unused. Applying a `ABSL_ATTRIBUTE_UNUSED` on the variable triggers `-Wused-but-marked-unused` when `STRIP_LOG` is off, not applying the attribute triggers `-Wunused-but-set-variable` when `STRIP_LOG` is on. Define a new internal macro `ABSL_LOG_INTERNAL_ATTRIBUTE_UNUSED_IF_STRIP_LOG` that evaluates to `ABSL_ATTRIBUTE_UNUSED` when `STRIP_LOG` is on and nothing when `STRIP_LOG` is off to address both of these scenarios. PiperOrigin-RevId: 625049155 Change-Id: Ia3f8a6ca916dd67a287bbda4b9bd6c574c92247a
Showing
Please
register
or
sign in
to comment