[PATCH] pg_filedump is broken

Started by Aleksander Alekseevover 9 years ago3 messages
#1Aleksander Alekseev
a.alekseev@postgrespro.ru
2 attachment(s)

Hello.

First patch fixes:

```
pg_filedump.c: In function ‘FormatItem’:
pg_filedump.c:994:18: error: ‘SizeOfIptrData’ undeclared (first use in
this function)
if (numBytes < SizeOfIptrData)
```

After 8023b582 there is no more SizeOfIptrData macro.

Second patch fixes Makefile. On some systems (notably FreeBSD) there is
no `gcc` by default. Using `cc` is a more crossplatform way to compile a
project.

--
Best regards,
Aleksander Alekseev

Attachments:

0001-pg_filedump.patchtext/x-diff; charset=us-asciiDownload
diff --git a/pg_filedump.c b/pg_filedump.c
index 2f2cd53..ba55711 100644
--- a/pg_filedump.c
+++ b/pg_filedump.c
@@ -991,7 +991,7 @@ FormatItem(unsigned int numBytes, unsigned int startIndex,
 	if (formatAs == ITEM_INDEX)
 	{
 		/* It is an IndexTuple item, so dump the index header */
-		if (numBytes < SizeOfIptrData)
+		if (numBytes < sizeof(ItemPointerData))
 		{
 			if (numBytes)
 			{
0002-pg_filedump.patchtext/x-diff; charset=us-asciiDownload
diff --git a/Makefile b/Makefile
index 29c1057..b30dbec 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 # note this must match version macros in pg_filedump.h
 FD_VERSION=9.6.0
 
-CC=gcc
+CC=cc
 CFLAGS=-g -O -Wall -Wmissing-prototypes -Wmissing-declarations
 
 # If working with a PG source directory, point PGSQL_INCLUDE_DIR to its
#2Christoph Berg
myon@debian.org
In reply to: Aleksander Alekseev (#1)
Re: [PATCH] pg_filedump is broken

Re: Aleksander Alekseev 2016-10-12 <20161012111527.GA17916@e733.localdomain>

Hello.

First patch fixes:

```
pg_filedump.c: In function ‘FormatItem’:
pg_filedump.c:994:18: error: ‘SizeOfIptrData’ undeclared (first use in
this function)
if (numBytes < SizeOfIptrData)
```

After 8023b582 there is no more SizeOfIptrData macro.

Thanks, pushed to filedump git.

Second patch fixes Makefile. On some systems (notably FreeBSD) there is
no `gcc` by default. Using `cc` is a more crossplatform way to compile a
project.

I think we just shouldn't set CC at all. Pushed along with some more
usage of pg_config.

Christoph

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

#3Christoph Berg
cb@df7cb.de
In reply to: Christoph Berg (#2)
Re: [PATCH] pg_filedump is broken

The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: not tested
Documentation: not tested

pg_filedump is a separate git repo, so the commitfest app won't let me mark this as commited by me. I'll mark it as "returned with feedback". Thanks!

The new status of this patch is: Ready for Committer

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