pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Marino <draco@marino.st>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7588: pgsql 9.1 incompatible with zlib 1.27
Date: Sun, 07 Oct 2012 22:06:32 +0200
Message-ID: <5071E0C8.40205@marino.st> (raw)
In-Reply-To: <16476.1349639653@sss.pgh.pa.us>
References: <E1TKpeW-0001Gg-Dg@wrigleys.postgresql.org>
	<13048.1349627764@sss.pgh.pa.us>
	<5071B902.6030505@marino.st>
	<14190.1349631338@sss.pgh.pa.us>
	<5071C248.5020206@marino.st>
	<15810.1349637294@sss.pgh.pa.us>
	<5071DBB0.8040107@marino.st>
	<16476.1349639653@sss.pgh.pa.us>

On 10/7/2012 21:54, Tom Lane wrote:
> John Marino<draco@marino.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




view thread (12+ messages)  latest in thread

Message-ID: <5071E0C8.40205@marino.st>
Permalink:  ../5071E0C8.40205@marino.st/
Also on:    postgresql.org/message-id/5071E0C8.40205@marino.st

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: draco@marino.st, tgl@sss.pgh.pa.us
  Subject: Re: BUG #7588: pgsql 9.1 incompatible with zlib 1.27
  In-Reply-To: <5071E0C8.40205@marino.st>
  References: <E1TKpeW-0001Gg-Dg@wrigleys.postgresql.org> <13048.1349627764@sss.pgh.pa.us> <5071B902.6030505@marino.st> <14190.1349631338@sss.pgh.pa.us> <5071C248.5020206@marino.st> <15810.1349637294@sss.pgh.pa.us> <5071DBB0.8040107@marino.st> <16476.1349639653@sss.pgh.pa.us> <5071E0C8.40205@marino.st>

* 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