DescriptionPatrick Baggett
2007-12-11 15:19:43 EST
I have modified the default makefile to use Sun's C compiler instead of GCC like the maintainer Vincent uses since Sun's C compiler generally produces much better code than GCC. In the compilation process, unzip.c had an error about converting from void* type to a function pointer type on line 4051.
inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
Changing the Z_NULL (which is of type void*), to the correct typedef'd function pointer type as used by inflate_blocks_new()'s prototype fixes the error.
inflate_blocks_new(z, z->state->nowrap ? ((check_func)0) : adler32, (uInt)1 << w))
Reasoning: ISO C forbids the typecast from data pointer to function pointer. Sun's C compiler refuses to output just a warning and instead raises it to an error status when seen. GCC and MSVC usually emit a warning that notes that this is actually forbidded by the C standard. To me honestly, pointers are pointers, but the ISO C standard also gives aliasing rules based on typecasts between types (see http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html for information/examples), and technically it is possible for the compiler to legally output incorrect code in such mentioned cases.
Reported against revision 1232.
Patrick Baggett
Figgle Software
Created attachment 1619 [details] Fix incorrect pointer typecast as mentioned.