From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: C++ Headers |
Date: | 2001-05-23 15:35:31 |
Message-ID: | 200105231535.f4NFZVN08207@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> > > > We have added more const-ness to libpq++ for 7.2.
> > >
> > > Breaking link compatibility without bumping the major version number
> > > on the library seems to me serious no-no.
> > >
> > > To const-ify member functions without breaking link compatibility,
> > > you have to add another, overloaded member that is const, and turn
> > > the non-const function into a wrapper. For example:
> > >
> > > void Foo::bar() { ... } // existing interface
> > >
> > > becomes
> > >
> > > void Foo::bar() { ((const Foo*)this)->bar(); }
> > > void Foo::bar() const { ... }
> >
> > Thanks. That was my problem, not knowing when I break link compatiblity
> > in C++. Major updated.
>
> Wouldn't it be better to add the forwarding function and keep
> the same major number? It's quite disruptive to change the
> major number for what are really very minor changes. Otherwise
> you accumulate lots of near-copies of almost-identical libraries
> to be able to run old binaries.
>
> A major-number bump should usually be something planned for
> and scheduled.
That const was just one of many const's added, and I am sure there will
be more stuff happening to C++. I changed a function returning short
for tuple length to int. Not worth mucking it up.
If it was just that one it would be OK.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-05-23 15:38:07 | Re: SEP_CHAR |
Previous Message | Tom Lane | 2001-05-23 15:32:56 | Re: Not released yet, but could someone take a quick peak ... |