Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-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

pgsql-hackers by date

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

pgsql-committers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group