Re: [PATCH] Fix Solaris Workshop Compiler issues
From: Guido Ostkamp <hidden>
Date: 2016-06-15 22:43:51
On Wed, 14 Nov 2007, Junio C Hamano wrote:
Alex Riesen [off-list ref] writes:quoted
Guido Ostkamp, Wed, Nov 14, 2007 21:31:13 +0100:quoted
... cc: acomp failed for diff-delta.c make: *** [diff-delta.o] Error 2 This is because 'struct delta_index' is declared with no size in delta.h and with size in diff-delta.c which does not fit.Huh?! Ever heard of forward declaration?We are not the first people who pass around a pointer to an opaque struct in the API to hide away the implementation. It would be surprising if the Workshop Compiler chokes on this and not other projects.
You got the original error report from Sun's compiler included in my earlier email. This happens with at least Sun Forte 6.1 (Solaris 8) and Sun Workshop 11 (Solaris 10), IIRC. The function declarations regarding create_delta() in delta.h and diff-delta.c are identical with respect to the type names of the parameter (only some internal names e.g. like 'buf' vs. 'trg_buf' are slightly different, but this has no effect). The main difference is that the 'struct delta_index' is opaque in delta.h and non-opaque in diff-delta.c; the patch clearly shows it solves the error. So we've got a solution. If you feel we could try something else, please let me know and I'll check it out. Please keep me on CC, as I'm not subscribed to the list, thanks. Regards Guido