From eaf281214712873c869f8ff8f454b31a636c60a1 Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Fri, 17 Nov 2023 11:19:04 +0100 Subject: [PATCH] [meta] Add custom range start/end to sai_object_type_t and sai_api_t as workaround for internal enum size (#1926) Workadound for #1925 Since SAI_OBJECT_TYPE_EXTENSIONS_MAX is declared as define, compiler warns about: error: the result of the conversion is unspecified because .129. is outside the range of type .sai_object_type_t. {aka ._sai_object_type_t.} [-Werror=conversion] when next value exceeds 7 bits, since that's enough for encode all values for sai_object_type_t. Unfortunetly #pragma GCC diagnostic ignored "-Wconversion" is not working (probably gcc bug) then workaround needs to be addressed in other way. Those custom ranges can be removed after actual SAI_OBJECT_TYPE_MAX will reach 128 value Also update sai_api_t, same issue as sai_object_type_t. This is temporary workaround. --- inc/sai.h | 6 ++++++ inc/saitypes.h | 10 +++++++++- meta/saisanitycheck.c | 2 ++ meta/saiserializetest.c | 12 ++++++------ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/inc/sai.h b/inc/sai.h index 069edd922..0fabbca9d 100644 --- a/inc/sai.h +++ b/inc/sai.h @@ -147,6 +147,12 @@ typedef enum _sai_api_t SAI_API_ARS_PROFILE = 49, /**