eina - value - disable warnings for ptr math

we over-alloc thus  this warning is not right. silence the warning
This commit is contained in:
Carsten Haitzler 2024-05-30 17:07:05 +01:00
parent 7e346e7bc2
commit 305750875e
1 changed files with 6 additions and 0 deletions

View File

@ -486,14 +486,20 @@ eina_value_pset(Eina_Value *value, const void *ptr)
{
if (type == EINA_VALUE_TYPE_STRINGSHARE)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
const char *str = *((const char * const *) ptr);
#pragma GCC diagnostic pop
return eina_stringshare_replace((const char **)&value->value.ptr,
str);
}
else if (type == EINA_VALUE_TYPE_STRING)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
const char *str = *((const char * const *) ptr);
#pragma GCC diagnostic pop
if (value->value.ptr == str) return EINA_TRUE;
if (!str)
{