From: | Andres Freund <andres(at)2ndquadrant(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: pg_filedump 9.3: checksums (and a few other fixes) |
Date: | 2013-06-14 16:07:36 |
Message-ID: | 20130614160736.GI19500@alap2.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2013-06-14 11:59:04 -0400, Tom Lane wrote:
> Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> > I have a question about the commit though: shouldn't both functions be
> > static if they are in a .h file? Otherwise, it could lead to naming
> > conflicts. I suppose it's wrong to include the implementation file
> > twice, but it still might be confusing if someone tries. Two ideas that
> > come to mind are:
> > * make both static and then have a trivial wrapper in checksum.c
> > * export one or both functions, but use #ifndef CHECKSUM_IMPL_H to
> > prevent redefinition
>
> Ah, you are right, I forgot the #ifndef CHECKSUM_IMPL_H dance. Will fix
> in a bit.
That won't help against errors if it's included in two different
files/translation units though. I don't really see a valid case where it
could be validly be included multiple times in one TU?
If anything we should #error in that case, but I am not sure it's worth
bothering.
E.g. in rmgrlist.h we have the following comment:
/* there is deliberately not an #ifndef RMGRLIST_H here */
and I think the reasoning behind that comment applies here as well.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Davis | 2013-06-14 16:21:12 | Re: Patch for fail-back without fresh backup |
Previous Message | Kevin Grittner | 2013-06-14 16:05:29 | refresh materialized view concurrently |