Re: CVS HEAD compile failure

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CVS HEAD compile failure
Date: 2003-12-08 17:52:01
Message-ID: 3FD4BA41.8010604@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>
>
>>Andrew Dunstan wrote:
>>
>>
>>>fresh checkout just compiled fine for me on Linux (RH8) with ssl
>>>enabled. Maybe it is your openssl installation?
>>>
>>>
>
>
>
>>It is openssl 0.9.7c. 7.4 CVS compiles fine so I don't see how it can
>>be my SSL install.
>>
>>
>
>I've been able to reproduce this on one of my machines, and it's nasty.
>It's a conflict between other people's headers.
>
>/usr/local/include/zlib.h (version 1.1.4) quoth:
>
>typedef void (*free_func) OF((voidpf opaque, voidpf address));
>
>/usr/local/ssl/include/openssl/crypto.h (0.9.7c) quoth:
>
>int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *));
>
>So if this version of zlib.h is included before this version of
>crypto.h, things break. Other way 'round works fine.
>
>We can work around this by being more careful about inclusion order
>of these headers. Ultimately it would be nice if the upstream library
>authors could avoid the name conflict. I'm of the opinion that zlib
>should not be typedef'ing a name as generic as "free_func", but if
>they've made that part of their exported API, it might be hard for them
>to change.
>

In that case I'm confused about why this code compiles on my machine:

----------------
#include <stdio.h>
#include <zconf.h>

typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void (*free_func) OF((voidpf opaque, voidpf address));

int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void
(*free_func)(void *));

int main()
{
return 0;
}
--------------------

Also, in compiling pg_dump/common.c, zlib.h (which has this typedef on
my machine) *is* included before openssl/crypto.h.

Either there is something I'm not getting (quite possible ;-) ), or the
problem lies deeper. (compiler version maybe?)

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message strk 2003-12-08 17:55:47 Re: ERROR: Index pg_toast_8443892_index is not a btree
Previous Message Jack Coates 2003-12-08 17:43:45 Re: tuning questions