Re: Bugs in ecpg's macro mechanism

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Bugs in ecpg's macro mechanism
Date: 2024-04-16 00:47:16
Message-ID: 1063578.1713228436@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2024-04-15 17:48:32 -0400, Tom Lane wrote:
>> But I have no idea about making it work in meson. Any suggestions?

> So you just want to compile define.c twice? The below should suffice:

> - 'define': ['-DCMDLINESYM=123'],
> + 'define': ['-DCMDLINESYM=123', files('define.pgc')],

Ah, thanks. I guess this depends on getopt_long reordering arguments
(since the "-o outfile" bit will come later). That is safe enough
in HEAD since 411b72034, but it might fail on weird platforms in v16.
How much do we care about that? (We can avoid that hazard in the
makefile build easily enough.)

> I assume that was just an test hack, because it leads to the build failing
> because of main being duplicated. But it'd work the same with another, "non
> overlapping", file.

Yeah, I hadn't actually worked through what to do in detail.
Here's a v2 that adds that testing. I also added some more
user-facing doco, and fixed a small memory leak that I noted
from valgrind testing. (It's hardly the only one in ecpg,
but it was easy to fix as part of this patch.)

regards, tom lane

Attachment Content-Type Size
v2-0001-Fix-assorted-bugs-in-ecpg-s-macro-mechanism.patch text/x-diff 21.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2024-04-16 00:56:07 Re: What's our minimum ninja version?
Previous Message Michael Paquier 2024-04-16 00:35:59 Re: Security lessons from liblzma - libsystemd