From d725addd9211f037dacc78e66600526babe18dc1 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 22 Nov 2022 14:50:14 +0100 Subject: warnings: Work around MSVC bug MSVC apparently complains when passing a `const char **` to memset. Unlike `const char *const *`, this isn't a pointer to const memory. --- testdict.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'testdict.c') diff --git a/testdict.c b/testdict.c index 40bebd05..4d745525 100644 --- a/testdict.c +++ b/testdict.c @@ -159,7 +159,8 @@ static int run_test2(xmlDictPtr parent) { fprintf(stderr, "Out of memory while creating sub-dictionary\n"); exit(1); } - memset(test2, 0, sizeof(test2)); + /* Cast to avoid buggy warning on MSVC. */ + memset((void *) test2, 0, sizeof(test2)); /* * Fill in NB_STRINGS_MIN, at this point the dictionary should not grow @@ -322,7 +323,8 @@ static int run_test1(void) { fprintf(stderr, "Out of memory while creating dictionary\n"); exit(1); } - memset(test1, 0, sizeof(test1)); + /* Cast to avoid buggy warning on MSVC. */ + memset((void *) test1, 0, sizeof(test1)); /* * Fill in NB_STRINGS_MIN, at this point the dictionary should not grow -- cgit v1.2.1