Re: warning: dereferencing type-punned pointer
| От | Tom Lane |
|---|---|
| Тема | Re: warning: dereferencing type-punned pointer |
| Дата | |
| Msg-id | 1254018.1721844589@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: warning: dereferencing type-punned pointer (Peter Eisentraut <peter@eisentraut.org>) |
| Ответы |
Re: warning: dereferencing type-punned pointer
Re: warning: dereferencing type-punned pointer |
| Список | pgsql-hackers |
Peter Eisentraut <peter@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
В списке pgsql-hackers по дате отправления: