Re: Bugs in ecpg's macro mechanism
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-04-16T00:47:16Z
Lists: pgsql-hackers
Attachments
- v2-0001-Fix-assorted-bugs-in-ecpg-s-macro-mechanism.patch (text/x-diff) patch v2-0001
Andres Freund <andres@anarazel.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
Commits
-
Fix assorted bugs in ecpg's macro mechanism.
- 6f0cef9353fc 17.0 landed
- 4631646391ec 14.12 landed
- 392e6e9e6ada 16.3 landed
- 2b6a74afe170 12.19 landed
- 25f937217200 15.7 landed
- 02531e8ca8dc 13.15 landed