diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-11-22 14:50:14 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-11-22 15:49:27 +0100 |
commit | d725addd9211f037dacc78e66600526babe18dc1 (patch) | |
tree | ab875fb87a720cd383334778da41efba3cff036e /testdict.c | |
parent | cfbe68e46877cb0ff3f3da775b709c48513565c8 (diff) | |
download | libxml2-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |