Re: [PATCH] Fix wrong argument to SOFT_ERROR_OCCURRED in timestamptz_date - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCH] Fix wrong argument to SOFT_ERROR_OCCURRED in timestamptz_date
Date
Msg-id 692b9dba-3060-49e3-99c4-136b1f7cc4e9@eisentraut.org
Whole thread Raw
In response to Re: [PATCH] Fix wrong argument to SOFT_ERROR_OCCURRED in timestamptz_date  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: [PATCH] Fix wrong argument to SOFT_ERROR_OCCURRED in timestamptz_date
List pgsql-hackers
On 24.03.26 21:53, Nathan Bossart wrote:
> LGTM.  To prevent this from happening in the future, I think we ought to
> change SOFT_ERROR_OCCURRED to a static inline function.  I tried that, and
> I got the following warnings:
> 
>      execExprInterp.c:4964:27: warning: incompatible pointer types passing 'ErrorSaveContext *' (aka 'struct
ErrorSaveContext*') to parameter of type 'Node *' (aka 'struct Node *') [-Wincompatible-pointer-types]
 
>       4964 |                 if (SOFT_ERROR_OCCURRED(&jsestate->escontext))
>            |                                         ^~~~~~~~~~~~~~~~~~~~
>      ../../../src/include/nodes/miscnodes.h:54:27: note: passing argument to parameter 'escontext' here
>         54 | SOFT_ERROR_OCCURRED(Node *escontext)
>            |                           ^
>      execExprInterp.c:5200:26: warning: incompatible pointer types passing 'ErrorSaveContext *' (aka 'struct
ErrorSaveContext*') to parameter of type 'Node *' (aka 'struct Node *') [-Wincompatible-pointer-types]
 
>       5200 |         if (SOFT_ERROR_OCCURRED(&jsestate->escontext))
>            |                                 ^~~~~~~~~~~~~~~~~~~~
>      ../../../src/include/nodes/miscnodes.h:54:27: note: passing argument to parameter 'escontext' here
>         54 | SOFT_ERROR_OCCURRED(Node *escontext)
>            |                           ^
> 
> I think we just need to add casts to "Node *" for those.  AFAICT there
> isn't an actual bug.

Or maybe we change the escontext field to be of type Node *?




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Fix wrong argument to SOFT_ERROR_OCCURRED in timestamptz_date
Next
From: Ashutosh Bapat
Date:
Subject: Re: pg_buffercache: Add per-relation summary stats