pgsql: Adjust basebackup.c to suppress compiler warnings.

Started by Tom Laneover 15 years ago4 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Adjust basebackup.c to suppress compiler warnings.

Some versions of gcc complain about "variable `tablespaces' might be
clobbered by `longjmp' or `vfork'" with the original coding. Fix by
moving the PG_TRY block into a separate subroutine.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=e6dce4e439e1d271dad9a95bc4b94147be2fc39a

Modified Files
--------------
src/backend/replication/basebackup.c | 54 ++++++++++++++++++++-------------
1 files changed, 33 insertions(+), 21 deletions(-)

#2Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#1)
Re: pgsql: Adjust basebackup.c to suppress compiler warnings.

On Tue, Jan 11, 2011 at 19:42, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Adjust basebackup.c to suppress compiler warnings.

Some versions of gcc complain about "variable `tablespaces' might be
clobbered by `longjmp' or `vfork'" with the original coding.  Fix by
moving the PG_TRY block into a separate subroutine.

I noticed you didn't create a function prototype at the top of the
file for this function. Was that intentional, or missed? If it was
intentional, can you give me a quick lesson in when it should be done
and whe nit shouldn't? :-)

//Magnus

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=e6dce4e439e1d271dad9a95bc4b94147be2fc39a

Modified Files
--------------
src/backend/replication/basebackup.c |   54 ++++++++++++++++++++-------------
1 files changed, 33 insertions(+), 21 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#2)
Re: pgsql: Adjust basebackup.c to suppress compiler warnings.

Magnus Hagander <magnus@hagander.net> writes:

On Tue, Jan 11, 2011 at 19:42, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Some versions of gcc complain about "variable `tablespaces' might be
clobbered by `longjmp' or `vfork'" with the original coding. �Fix by
moving the PG_TRY block into a separate subroutine.

I noticed you didn't create a function prototype at the top of the
file for this function. Was that intentional, or missed? If it was
intentional, can you give me a quick lesson in when it should be done
and whe nit shouldn't? :-)

Oh, I just missed that you had ones for all the others. Feel free to
add it.

regards, tom lane

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#3)
Re: pgsql: Adjust basebackup.c to suppress compiler warnings.

Magnus Hagander <magnus@hagander.net> writes:

I noticed you didn't create a function prototype at the top of the
file for this function. Was that intentional, or missed? If it was
intentional, can you give me a quick lesson in when it should be done
and whe nit shouldn't? :-)

I think normally you can omit the prototype when the function definition
comes before its first usage.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support