Re: Pointer subtraction with a null pointer

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Pointer subtraction with a null pointer
Date: 2022-03-26 18:41:47
Message-ID: 20220326184147.dhkoghv52kkfrpi4@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-03-26 14:13:56 -0400, Tom Lane wrote:
> The attached also silences the warning, and getting rid of the double-eval
> hazard seems like a net win.

Looks good wrt relptr_store. Maybe we should fix the double-eval hazard in
relptr_access too, think that'd be only one left over...

> > Might also be worth adding an assertion that base < val.
>
> Did that too. On the whole I like this better.

Better than the relptr_store_null() approach I assume? Agreed, if so.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-03-26 18:47:07 Why is lorikeet so unstable in v14 branch only?
Previous Message Robert Haas 2022-03-26 18:40:06 Re: pgsql: Add 'basebackup_to_shell' contrib module.