Re: new compiler warnings - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: new compiler warnings
Date
Msg-id 201101270018.p0R0IGB26064@momjian.us
Whole thread Raw
In response to Re: new compiler warnings  (Bruce Momjian <bruce@momjian.us>)
Responses Re: new compiler warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: new compiler warnings  (Bruce Momjian <bruce@momjian.us>)
Re: new compiler warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:
> Robert Haas wrote:
> > I recently started getting these:
> >
> > plpython.c: In function ?PLy_output?:
> > plpython.c:3468: warning: format not a string literal and no format arguments
> > plpython.c: In function ?PLy_elog?:
> > plpython.c:3620: warning: format not a string literal and no format arguments
> > plpython.c:3627: warning: format not a string literal and no format arguments
>
> And I see this warning:
>
>     compress_io.c:597: warning: passing arg 2 of `gzwrite' discards
>         qualifiers from pointer target type

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));

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/src/bin/pg_dump/compress_io.c b/src/bin/pg_dump/compress_io.c
index fb280ab..a00bb54 100644
*** a/src/bin/pg_dump/compress_io.c
--- b/src/bin/pg_dump/compress_io.c
*************** cfwrite(const void *ptr, int size, cfp *
*** 594,600 ****
  {
  #ifdef HAVE_LIBZ
      if (fp->compressedfp)
!         return gzwrite(fp->compressedfp, ptr, size);
      else
  #endif
          return fwrite(ptr, 1, size, fp->uncompressedfp);
--- 594,600 ----
  {
  #ifdef HAVE_LIBZ
      if (fp->compressedfp)
!         return gzwrite(fp->compressedfp, (void *)ptr, size);
      else
  #endif
          return fwrite(ptr, 1, size, fp->uncompressedfp);

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [NOVICE] systable_getnext_ordered
Next
From: Noah Misch
Date:
Subject: Re: ALTER TYPE 3: add facility to identify further no-work cases