pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: Michael Meskes <meskes@postgresql.org>
Subject: Inconsistent function definitions in ECPG's informix.c
Date: Wed, 27 Jan 2021 11:22:14 -0500
Message-ID: <2401575.1611764534@sss.pgh.pa.us> (raw)

I noticed that some of the newer compilers in the buildfarm
(e.g., caiman, with gcc 11.0) whine about the definitions of
rjulmdy() and rmdyjul() not quite matching their external
declarations:

informix.c:516:23: warning: argument 2 of type `short int[3]' with mismatched bound [-Warray-parameter=]
  516 | rjulmdy(date d, short mdy[3])
      |                 ~~~~~~^~~~~~
In file included from informix.c:10:
../include/ecpg_informix.h:38:31: note: previously declared as `short int *'
   38 | extern int      rjulmdy(date, short *);
      |                               ^~~~~~~
informix.c:567:15: warning: argument 1 of type `short int[3]' with mismatched bound [-Warray-parameter=]
  567 | rmdyjul(short mdy[3], date * d)
      |         ~~~~~~^~~~~~
In file included from informix.c:10:
../include/ecpg_informix.h:41:25: note: previously declared as `short int *'
   41 | extern int      rmdyjul(short *, date *);
      |                         ^~~~~~~

This isn't a bug really, since per the C spec these declarations
are equivalent.  But it'd be good to silence the warning before
it gets any more common.

The most conservative thing to do would be to take the user-visible
extern declarations as being authoritative, and change informix.c
to match.  I'm slightly tempted to do the opposite though, on the
grounds that showing the expected lengths of the arrays is useful.
But I wonder if anyone's compatibility checker tools would
(mistakenly) classify that as an ABI break.

Thoughts?

			regards, tom lane





Message-ID: <2401575.1611764534@sss.pgh.pa.us>
Permalink:  ../2401575.1611764534@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2401575.1611764534@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org, meskes@postgresql.org
  Subject: Re: Inconsistent function definitions in ECPG's informix.c
  In-Reply-To: <2401575.1611764534@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox