I am following these instructions to test the zlibStat library with testzlib. When I try to build testzlib, it throws the following error in testzlib.c, Line: 167, Char:43:
IntelliSense: argument of type "unsigned char **" is incompatible with parameter of type "void **"
Is it a specification change in C11, a bug in VC 11 or a bad code?
Is there a workaround? I tried changing unsigned char* FilePtr; to void* FilePtr;, but then the assignment operator throws the error on Line 200. Any thoughts?
Solution
I followed Icepack’s answer. Then I got an error on line 141, so I changed it to *pFilePtr=(unsigned char*)ptr;. Hopefully zlib guys would update their code accordingly.
Implicit conversion doesn’t work with double indirection. Converting
char*tovoid*is ok, butchar**tovoid**isn’t. See here for more details: http://c-faq.com/ptrs/genericpp.htmlTry replacing the
ReadFileMemorysignature withReadFileMemory(const char* filename,long* plFileSize,unsigned char** pFilePtr).