Re: warning: dereferencing type-punned pointer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Tatsuo Ishii <ishii(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: warning: dereferencing type-punned pointer
Date: 2024-07-24 18:31:41
Message-ID: 1256529.1721845901@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> If you change the member to a pointer

> - ErrorSaveContext escontext;
> + ErrorSaveContext *escontext;
> } JsonExprState;

> and make the required adjustments elsewhere in the code, the warning
> goes away.

> This arrangement would also appear to be more consistent with other
> executor nodes (e.g., ExprState, ExprEvalStep), so it might be worth it
> for consistency in any case.

+1, makes sense to me.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-07-24 18:36:34 Re: improve performance of pg_dump with many sequences
Previous Message Tom Lane 2024-07-24 18:29:45 Re: warning: dereferencing type-punned pointer