Skip to content

Commit

Permalink
Workaround 'x can be declared as pointer to const' cppcheck FP in gctest
Browse files Browse the repository at this point in the history
(fix of commit 3936d7c)

Issue #629 (bdwgc).

* tests/gctest.c [CPPCHECK] (run_one_test): Pass x argument to
GC_noop1() regardless of DBG_HDRS_ALL.
  • Loading branch information
ivmai committed Mar 29, 2024
1 parent 4d6cdc0 commit 55d3a91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/gctest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,9 +1553,6 @@ static void run_one_test(void)
test_tinyfl();
# ifndef DBG_HDRS_ALL
x = (char *)checkOOM(GC_malloc(7));
# if defined(CPPCHECK)
GC_noop1((GC_word)x);
# endif
AO_fetch_and_add1(&collectable_count);
y = (char *)checkOOM(GC_malloc(7));
AO_fetch_and_add1(&collectable_count);
Expand Down Expand Up @@ -1717,6 +1714,9 @@ static void run_one_test(void)
GC_printf("GC_strndup unexpected result\n");
FAIL;
}
# if defined(CPPCHECK)
GC_noop1((GC_word)x);
# endif
# ifdef GC_REQUIRE_WCSDUP
{
static const wchar_t ws[] = { 'a', 'b', 'c', 0 };
Expand Down

0 comments on commit 55d3a91

Please sign in to comment.