Re: space reserved for WAL record does not match what was written: panic on windows

From: Noah Misch <noah(at)leadboat(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: space reserved for WAL record does not match what was written: panic on windows
Date: 2013-10-18 20:46:18
Message-ID: 20131018204618.GA368286@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On Fri, Oct 18, 2013 at 09:05:38PM +1300, David Rowley wrote:
> As for signed vs unsigned, I've not looked at all of the places where
> MAXALIGN is used, but I just assumed it was for memory addresses, if this
> is the case then I'm confused why we'd ever want a negative valued memory
> address?

The result will invariably be cast to a pointer type before use, at which
point it's no longer negative. (That's not to say we should keep using signed
math, but it doesn't cause active problems for memory addresses.)

> This might be an obvious one, but can anyone tell me why the casts are in
> the macro at all? Can a compiler not decide for itself which type it should
> be using?

The casts allow passing values of pointer type, which are not valid as
arguments to the bitwise AND operator.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-10-18 21:16:04 Re: Turning recovery.conf into GUCs
Previous Message Andres Freund 2013-10-18 20:35:11 Re: Turning recovery.conf into GUCs

Browse pgsql-www by date

  From Date Subject
Next Message Noah Misch 2013-10-21 01:10:13 Re: signed vs. unsigned in TYPEALIGN (was Re: space reserved for WAL record does not match what was written: panic on windows)
Previous Message David Rowley 2013-10-18 08:05:38 Re: space reserved for WAL record does not match what was written: panic on windows