Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TKx7h-0002Dv-Hk for pgsql-bugs@postgresql.org; Sun, 07 Oct 2012 20:06:49 +0000 Received: from mail.synsport.com ([208.69.230.148] helo=shepard.synsport.net) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TKx7f-0008Vf-QW for pgsql-bugs@postgresql.org; Sun, 07 Oct 2012 20:06:48 +0000 Received: from [192.168.1.12] (134.red-88-9-108.dynamicip.rima-tde.net [88.9.108.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by shepard.synsport.net (Postfix) with ESMTP id 1C833435A3; Sun, 7 Oct 2012 15:06:43 -0500 (CDT) Message-ID: <5071E0C8.40205@marino.st> Date: Sun, 07 Oct 2012 22:06:32 +0200 From: John Marino User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: BUG #7588: pgsql 9.1 incompatible with zlib 1.27 References: <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> In-Reply-To: <16476.1349639653@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/58 X-Sequence-Number: 34358 On 10/7/2012 21:54, Tom Lane wrote: > John Marino 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