Improve const use in zlib-using code - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Improve const use in zlib-using code
Date
Msg-id 33462926-bb1e-7cc9-8d92-d86318e8ed1d@eisentraut.org
Whole thread Raw
Responses Re: Improve const use in zlib-using code
List pgsql-hackers
Now that we have effectively de-supported CentOS 6, by removing support 
for its OpenSSL version, I think we could also modernize the use of some 
other libraries, such as zlib.

If we define ZLIB_CONST before including zlib.h, zlib augments some
interfaces with const decorations.  By doing that we can keep our own
interfaces cleaner and can remove some unconstify calls.

ZLIB_CONST was introduced in zlib 1.2.5.2 (17 Dec 2011); CentOS 6 has 
zlib-1.2.3-29.el6.x86_64.

Note that if you use this patch and compile on CentOS 6, it still works, 
you just get a few compiler warnings about discarding qualifiers.  Old 
environments tend to produce more compiler warnings anyway, so this 
doesn't seem so bad.
Attachment

pgsql-hackers by date:

Previous
From: Andrey Lepikhov
Date:
Subject: Re: [PoC] Reducing planning time when tables have many partitions
Next
From: Yugo NAGATA
Date:
Subject: Re: pgbnech: allow to cancel queries during benchmark