Skip to content

Commit

Permalink
Ignore certain GCC warnings in SHList test (libusual#52)
Browse files Browse the repository at this point in the history
New versions of GCC warn about pointer magic that SHList is actively
exploiting. This ignores those warnings.

Obviously it would be better to fix the warnings, but afaict that would
require huge changes to SHList. Since SHList is not used by PgBouncer
the impact of this is quite small and its not worth the effort to fix
this at the moment. This change at least makes CI green again.
  • Loading branch information
JelteF authored Jan 23, 2024
1 parent 89c8905 commit 46a78d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_shlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ static const char *xdel(struct SHList *list, int v)
return xshow(list);
}

#if (defined __GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overread"
#endif

static void test_shlist(void *p)
{
struct SHList rlist, *list = &rlist;
Expand Down Expand Up @@ -141,6 +147,9 @@ static void test_shlist(void *p)
int_check(shlist_empty(list), 1);
end:;
}
#if (defined __GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif

static void test_shlist_remove(void *p)
{
Expand Down

0 comments on commit 46a78d2

Please sign in to comment.