Skip site navigation (1) Skip section navigation (2)

pgsql: Fix incorrect uses of gzFile

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix incorrect uses of gzFile
Date: 2012-03-02 20:37:41
Message-ID: E1S3ZET-0005Vg-HV@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix incorrect uses of gzFile

gzFile is already a pointer, so code like

gzFile *handle = gzopen(...)

is wrong.

This used to pass silently because gzFile used to be defined as void*,
and you can assign a void* to a void**.  But somewhere between zlib
versions 1.2.3.4 and 1.2.6, the definition of gzFile was changed to
struct gzFile_s *, and with that new definition this usage causes
compiler warnings.

So remove all those extra pointer decorations.

There is a related issue in pg_backup_archiver.h, where

FILE       *FH;             /* General purpose file handle */

is used throughout pg_dump as sometimes a real FILE* and sometimes a
gzFile handle, which also causes warnings now.  This is not yet fixed
here, because it might need more code restructuring.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d923125b77c5d698bb8107a533a21627582baa43

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c |    4 ++--
src/bin/pg_dump/pg_backup_files.c     |    2 +-
src/bin/pg_dump/pg_backup_tar.c       |   11 ++++-------
3 files changed, 7 insertions(+), 10 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-03-03 14:04:48
Subject: pgsql: Allow CREATE TABLE (LIKE ...) from composite type
Previous:From: Peter EisentrautDate: 2012-03-02 20:12:20
Subject: pgsql: Re-add "make check" target in src/test/isolation/Makefile

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group