Re: pgsql: Modify pg_dump to use error-free memory allocation macros. This

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Modify pg_dump to use error-free memory allocation macros. This
Date: 2011-11-26 14:51:30
Message-ID: 4ED0FCF2.7020002@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 11/26/2011 09:18 AM, Bruce Momjian wrote:
> Tom Lane wrote:
>> Bruce Momjian<bruce(at)momjian(dot)us> writes:
>>> Modify pg_dump to use error-free memory allocation macros. This avoids
>>> ignoring errors and call-site error checking.
>> This appears to have broken the MSVC build. More generally, I'd like to
> Doesn't the MSVC build scrape the Makefiles? Looking at Mkvcbuild.pm,
> it seems it doesn't for pg_dump? When exactly does the MSVC build have
> to be adjusted for makefile changes?
>
> I will adjust Mkvcbuild.pm, assuming we want to keep this change.
>

I think the short answer is that the MSVC build system scrapes the
makefile for $OBJS but if you change the files on the target line you
will need to adjust it.

It has this for pg_dump:

my $pgdump = AddSimpleFrontend('pg_dump', 1);
$pgdump->AddIncludeDir('src\backend');
$pgdump->AddFile('src\bin\pg_dump\pg_dump.c');
$pgdump->AddFile('src\bin\pg_dump\common.c');
$pgdump->AddFile('src\bin\pg_dump\pg_dump_sort.c');
$pgdump->AddFile('src\bin\pg_dump\keywords.c');
$pgdump->AddFile('src\backend\parser\kwlookup.c');

But you have made this change in the makefile:

-pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(KEYWRDOBJS) |
submake-libpq submake-libpgport
- $(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(KEYWRDOBJS)
$(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $(at)$(X)
+pg_dump: pg_dump.o dumpcatalog.o pg_dump_sort.o $(OBJS)
$(KEYWRDOBJS) | submake-libpq submake-libpgport
+ $(CC) $(CFLAGS) pg_dump.o dumpcatalog.o pg_dump_sort.o
$(KEYWRDOBJS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX)
$(LIBS) -o $(at)$(X)

so above, I think you would need to replace:

$pgdump->AddFile('src\bin\pg_dump\common.c');

with

$pgdump->AddFile('src\bin\pg_dump\dumpcatalog.c');

cheers

andrew

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-11-26 15:58:39 Re: [COMMITTERS] pgsql: Modify pg_dump to use error-free memory allocation macros. This
Previous Message Bruce Momjian 2011-11-26 14:50:25 Re: pgsql: Modify pg_dump to use error-free memory allocation macros. This

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2011-11-26 15:21:48 Re: proposal : backend startup hook / after logon trigger
Previous Message Bruce Momjian 2011-11-26 14:50:25 Re: pgsql: Modify pg_dump to use error-free memory allocation macros. This