Re: new compiler warnings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: new compiler warnings
Date
Msg-id 9873.1296090511@sss.pgh.pa.us
Whole thread Raw
In response to Re: new compiler warnings  (Bruce Momjian <bruce@momjian.us>)
Responses Re: new compiler warnings  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> I can remove this warning by casting the pointer to (void *), rather
> than (const void *) because that is what the prototype uses on my system
> uses (libz.so.1.1.4):

>     ZEXTERN int ZEXPORT    gzwrite OF((gzFile file,
>                        const voidp buf, unsigned len));

BTW, I don't understand why that fixes it for you either.  As you can
see, gzwrite *is* declared with const.  The reason why you're getting a
warning is that zconf.h #define's const as nothing unless it thinks
you're on an ANSI compiler (and the difference between 1.1.4 and 1.2.3
is mostly that the former's test for ANSI-ness is brain dead).  But if
you're compiling that #define then const or lack of it should mean
nothing to you.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: new compiler warnings
Next
From: Robert Haas
Date:
Subject: Re: ALTER TYPE 3: add facility to identify further no-work cases