| From: | John Marino <draco(at)marino(dot)st> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: BUG #7588: pgsql 9.1 incompatible with zlib 1.27 |
| Date: | 2012-10-07 20:06:32 |
| Message-ID: | 5071E0C8.40205@marino.st |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On 10/7/2012 21:54, Tom Lane wrote:
> John Marino<draco(at)marino(dot)st> writes:
>> Perhaps, you need to take a closer look at this. I guarantee that I
>> didn't do this for cosmetic reasons. GCC behavior changed with GCC 4.5
>> on this topic.
>
> You should report it as a bug in whatever distro you're using, because
> the behavior did *not* change anywhere else, and the code you say your
> compiler is rejecting is clearly legal per C standard. sizeof() is
> a compile-time constant.
>
> regards, tom lane
Tom, it's a stock gcc47.
It's not "sizeof" that is causing the problem.
One cause is bufpage.h,
#define SizeOfPageHeaderData (offsetof(PageHeaderData, pd_linp))
Offsetof is the offender.
Two more on htup.h:
#define MINIMAL_TUPLE_PADDING \
((offsetof(HeapTupleHeaderData, t_infomask2) - sizeof(uint32)) %
MAXIMUM_ALIGNOF)
#define MaxHeapTuplesPerPage \
((int) ((BLCKSZ - SizeOfPageHeaderData) / \
(MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) + sizeof(ItemIdData))))
Again, offsetof is the offender in both cases.
Are you 100% sure that offsetof is evaluated at compile time? Is this
not part of section 6.6 that I quoted earlier?
John
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2012-10-07 20:26:33 | Re: BUG #7588: pgsql 9.1 incompatible with zlib 1.27 |
| Previous Message | Franco Ricci | 2012-10-07 19:59:25 | Re: BUG #7586: PL/Perl problem |