From 982ade4cf9babbac7ca3c5c8804fedbc30afb4fd Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Tue, 18 Mar 2025 11:20:51 +1300 Subject: [PATCH] [Compilers] Add a dummy function to suppress unused variable warning in GCC --- clay.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clay.h b/clay.h index fd74b7d..ca0d5a4 100644 --- a/clay.h +++ b/clay.h @@ -102,6 +102,10 @@ static uint8_t CLAY__ELEMENT_DEFINITION_LATCH; +// GCC marks the above CLAY__ELEMENT_DEFINITION_LATCH as an unused variable for files that include clay.h but don't declare any layout +// This is to suppress that warning +static inline void Clay__SuppressUnusedLatchDefinitionVariableWarning(void) { (void) CLAY__ELEMENT_DEFINITION_LATCH; } + // Publicly visible layout element macros ----------------------------------------------------- /* This macro looks scary on the surface, but is actually quite simple.