Peter Eisentraut <pe...@eisentraut.org> writes:
> On 24.07.24 16:05, Tom Lane wrote:
>> I'm not very thrilled with these changes.  It's not apparent why
>> your compiler is warning about these usages of IsA and not any other
>> ones,

> I think one difference is that normally IsA is called on a Node * (since 
> you call IsA to decide what to cast it to), but in this case it's called 
> on a pointer that is already of type ErrorSaveContext *.

Hmm.  But there are boatloads of places where we call IsA on a
pointer of type Expr *, or sometimes other things.  Why aren't
those triggering the same warning?

> I think here you could just bypass the SOFT_ERROR_OCCURRED macro:
> -       if (SOFT_ERROR_OCCURRED(&jsestate->escontext))
> +       if (jsestate->escontext.error_occurred)

Perhaps.  That's a bit sad because it's piercing a layer of
abstraction.  I do not like compiler warnings that can't be
gotten rid of without making the code objectively worse.

                        regards, tom lane


Reply via email to