summaryrefslogtreecommitdiff
path: root/testdict.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-11-22 14:50:14 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2022-11-22 15:49:27 +0100
commitd725addd9211f037dacc78e66600526babe18dc1 (patch)
treeab875fb87a720cd383334778da41efba3cff036e /testdict.c
parentcfbe68e46877cb0ff3f3da775b709c48513565c8 (diff)
downloadlibxml2-d725addd9211f037dacc78e66600526babe18dc1.tar.gz
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.
Diffstat (limited to 'testdict.c')
-rw-r--r--testdict.c6
1 files changed, 4 insertions, 2 deletions
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