pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ilmari <ilmari@ilmari.org>
Cc: Wei Sun <936739278@qq.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: Build error in Solaris
Date: Tue, 08 Feb 2022 16:53:01 -0500
Message-ID: <1290986.1644357181@sss.pgh.pa.us> (raw)
In-Reply-To: <1176583.1644323289@sss.pgh.pa.us>
References: <tencent_2EFCC8BA0107B6EC0F97179E019A8A43C806@qq.com>
	<1176583.1644323289@sss.pgh.pa.us>

I wrote:
> Hm.  I saw something similar on my old dinosaur pademelon, but wrote it
> off as "they don't care about pre-C99 compilers anymore".  But now I
> dug into ppport.h a bit more, and I think it's actually busted for
> non-gcc compilers: eval_pv expands into something that tries to use
> STMT_START/STMT_END inside a plain parenthesized expression (via
> croak_sv).

> Maybe the bleeding edge Devel::PPPort would do better?  I see

Nope, 3.64 is also broken.

I traced this to this stanza, originally added in Devel-PPPort 3.54:

/* Older Perl versions have broken croak_on_error=1 */
#if (PERL_BCDVERSION < 0x5031002)
# ifdef eval_pv
#  undef eval_pv
#  if defined(PERL_USE_GCC_BRACE_GROUPS)
#   define eval_pv(p, croak_on_error) ({ SV *_sv = Perl_eval_pv(aTHX_ p, 0); D_PPP_CROAK_IF_ERROR(croak_on_error); _sv; })
#  else
#   define eval_pv(p, croak_on_error) ((PL_Sv = Perl_eval_pv(aTHX_ p, 0)), D_PPP_CROAK_IF_ERROR(croak_on_error), PL_Sv)
#  endif
# endif
#endif

D_PPP_CROAK_IF_ERROR goes to croak_sv which, in older Perl
versions, produces a statement block.  So anything that won't
accept gcc-like statements within expressions blows up.

Now, we don't actually *care* about the case this is trying
to fix, because all our eval_pv usages pass constant-FALSE
for croak_on_error.  (Possibly not unrelated to the bug
implied by the above comment ... but I digress.)  Therefore,
pending a resolution to the issue I just filed [1], I suggest
that we just dike this stanza out of our copy of ppport.h.

			regards, tom lane

[1] https://github.com/Dual-Life/Devel-PPPort/issues/216





view thread (3+ messages)

Message-ID: <1290986.1644357181@sss.pgh.pa.us>
Permalink:  ../1290986.1644357181@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1290986.1644357181@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ilmari@ilmari.org, 936739278@qq.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Build error in Solaris
  In-Reply-To: <1290986.1644357181@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox