Re: warning: dereferencing type-punned pointer - Mailing list pgsql-hackers

From Tom Lane
Subject Re: warning: dereferencing type-punned pointer
Date
Msg-id 1218071.1721829945@sss.pgh.pa.us
Whole thread Raw
In response to warning: dereferencing type-punned pointer  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: warning: dereferencing type-punned pointer
List pgsql-hackers
Tatsuo Ishii <ishii@postgresql.org> writes:
> So I think the warnings in ExecEvalJsonExprPath are better fixed
> because these are the only places where IsA (nodeTag) macro are used
> and the warning is printed. Patch attached.

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, nor is it apparent why these changes suppress the warnings.
(The code's not fundamentally different, so I'd think the underlying
problem is still there, if there really is one at all.)
I'm afraid we'd be playing whack-a-mole to suppress similar warnings
on various compiler versions, with no end result other than making
the code uglier and less consistent.

If we can figure out why the warning is appearing, maybe it'd be
possible to adjust the definition of IsA() to prevent it.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Send duration output to separate log files
Next
From: Ashutosh Bapat
Date:
Subject: Re: [PATCH] GROUP BY ALL