Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id BBA712BF84 for ; Fri, 16 Dec 2011 11:33:39 -0400 (AST) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RbZmt-0001uO-Ck for pgsql-bugs@postgresql.org; Fri, 16 Dec 2011 15:33:39 +0000 Received: from [204.145.120.229] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RbZmg-0008EJ-K7 for pgsql-bugs@postgresql.org; Fri, 16 Dec 2011 15:33:19 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1RbZmg-0007KG-4v for pgsql-bugs@postgresql.org; Fri, 16 Dec 2011 15:33:18 +0000 Date: Fri, 16 Dec 2011 15:33:18 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6343: PGTYPES library missing qualifiers To: pgsql-bugs@postgresql.org From: kojiro@hello-channel.com X-Pg-Spam-Score: -4.1 (----) X-Archive-Number: 201112/135 X-Sequence-Number: 31946 The following bug has been logged on the website: Bug reference: 6343 Logged by: Daniel Loffgren Email address: kojiro@hello-channel.com PostgreSQL version: 9.1.1 Operating system: NetBSD Description: = In the ecpg PGTYPES library, there are functions like this: = extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, char *); The last argument is the formatting string, yet isn't constant. This generates warnings/errors on many compilers that are watching for discarding of qualifiers when passing in string literals. It's a simple fix, although I noticed that in PGTYPEStimestamp_defmt_asc the code is altering the formatter if it is null, which prevents making the formatter const. However, dttofmtasc_replace does not alter the formatter, and so should not pose a problem for PGTYPEStimestamp_fmt_asc which passes straight to it.