diff --git a/upb/message/internal/accessors.h b/upb/message/internal/accessors.h index 360ed61c66312..9fd353f476185 100644 --- a/upb/message/internal/accessors.h +++ b/upb/message/internal/accessors.h @@ -163,7 +163,7 @@ UPB_INLINE void UPB_PRIVATE(_upb_Message_SetPresence)( } } -UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)( +UPB_INLINE_IF_NOT_GCC void UPB_PRIVATE(_upb_MiniTableField_DataCopy)( const upb_MiniTableField* f, void* to, const void* from) { switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) { case kUpb_FieldRep_1Byte: @@ -183,7 +183,7 @@ UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)( UPB_UNREACHABLE(); } -UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataEquals)( +UPB_INLINE_IF_NOT_GCC bool UPB_PRIVATE(_upb_MiniTableField_DataEquals)( const upb_MiniTableField* f, const void* a, const void* b) { switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) { case kUpb_FieldRep_1Byte: diff --git a/upb/port/def.inc b/upb/port/def.inc index 13107958ea5e5..2413e729a1dde 100644 --- a/upb/port/def.inc +++ b/upb/port/def.inc @@ -91,6 +91,13 @@ Error, UINTPTR_MAX is undefined #define UPB_INLINE static #endif +// UPB_INLINE_IF_NOT_GCC: because gcc can be very noisy at times. +#if defined(__GNUC__) && !defined(__clang__) +#define UPB_INLINE_IF_NOT_GCC static +#else +#define UPB_INLINE_IF_NOT_GCC UPB_INLINE +#endif + #ifdef UPB_BUILD_API #define UPB_API UPB_EXPORT #define UPB_API_INLINE UPB_EXPORT diff --git a/upb/port/undef.inc b/upb/port/undef.inc index 99555fb933abb..03803d76c8337 100644 --- a/upb/port/undef.inc +++ b/upb/port/undef.inc @@ -16,6 +16,7 @@ #undef UPB_API #undef UPBC_API #undef UPB_API_INLINE +#undef UPB_API_INLINE_IF_NOT_GCC #undef UPB_ALIGN_UP #undef UPB_ALIGN_DOWN #undef UPB_ALIGN_MALLOC