BUG #2457: Make fails at copydir.c / copydir.o

Started by William Grayalmost 20 years ago5 messagesbugs
Jump to latest
#1William Gray
grayw@mail.montclair.edu

The following bug has been logged online:

Bug reference: 2457
Logged by: William Gray
Email address: grayw@mail.montclair.edu
PostgreSQL version: 8.1.4
Operating system: Mac OS X Tiger 10.4.6 (PowerPC)
Description: Make fails at copydir.c / copydir.o
Details:

When I run the make for 8.1.4, a number of parse errors are thrown, causing
the build to fail.

Using GNU bison 2.1 via /usr/local/bin instead of mac os x bison (1.28).
This doesn't seem to help.

Also saw bug #1959 and other archives not on incompatibility fix for tiger's
readline, seems unrelated, didn't help.

I've done some looking in the archives for ports and bugs lists, but I
haven't been able to find something similar (apologies if this has already
been dealt with). Is there a searchable bugs database where I can look up
related bugs by platform?

My build so far:

export CFLAGS="-mtune=G5 -mcpu=G5"

./configure --without-tcl --without-krb5 --with-openssl --with-readline
--with-pam --with-bonjour --prefix=/usr/local/postgresql-8.1.4 --with-perl

make produces the following error (it's kinda long):

gcc -no-cpp-precomp -mtune=G5 -mcpu=G5 -Wall -Wmissing-prototypes
-Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels
-fno-strict-aliasing -I../../src/port -DFRONTEND -I../../src/include -c -o
copydir.o copydir.c
In file included from ../../src/include/postgres.h:48,
from copydir.c:19:
../../src/include/c.h:194: error: parse error before '*' token
../../src/include/c.h:194: warning: type defaults to 'int' in declaration of
'BoolPtr'
../../src/include/c.h:194: warning: data definition has no type or storage
class
In file included from ../../src/include/c.h:822,
from ../../src/include/postgres.h:48,
from copydir.c:19:
../../src/include/port.h:23: error: parse error before "pg_set_noblock"
../../src/include/port.h:23: warning: type defaults to 'int' in declaration
of 'pg_set_noblock'
../../src/include/port.h:23: warning: data definition has no type or storage
class
../../src/include/port.h:24: error: parse error before "pg_set_block"
../../src/include/port.h:24: warning: type defaults to 'int' in declaration
of 'pg_set_block'
../../src/include/port.h:24: warning: data definition has no type or storage
class
../../src/include/port.h:35: error: parse error before
"path_contains_parent_reference"
../../src/include/port.h:35: warning: type defaults to 'int' in declaration
of 'path_contains_parent_reference'
../../src/include/port.h:35: warning: data definition has no type or storage
class
../../src/include/port.h:36: error: parse error before
"path_is_prefix_of_path"
../../src/include/port.h:36: warning: type defaults to 'int' in declaration
of 'path_is_prefix_of_path'
../../src/include/port.h:36: warning: data definition has no type or storage
class
../../src/include/port.h:49: error: parse error before "get_home_path"
../../src/include/port.h:49: warning: type defaults to 'int' in declaration
of 'get_home_path'
../../src/include/port.h:49: warning: data definition has no type or storage
class
../../src/include/port.h:181: error: parse error before "bool"
../../src/include/port.h:244: error: parse error before "bool"
../../src/include/port.h:246: error: parse error before "rmtree"
../../src/include/port.h:246: error: parse error before "bool"
../../src/include/port.h:246: warning: type defaults to 'int' in declaration
of 'rmtree'
../../src/include/port.h:246: warning: data definition has no type or
storage class
In file included from ../../src/include/postgres.h:49,
from copydir.c:19:
../../src/include/utils/elog.h:101: error: parse error before "errstart"
../../src/include/utils/elog.h:102: warning: type defaults to 'int' in
declaration of 'errstart'
../../src/include/utils/elog.h:102: warning: data definition has no type or
storage class
../../src/include/utils/elog.h:240: error: parse error before "bool"
../../src/include/utils/elog.h:240: warning: no semicolon at end of struct
or union
../../src/include/utils/elog.h:241: warning: type defaults to 'int' in
declaration of 'output_to_client'
../../src/include/utils/elog.h:241: warning: data definition has no type or
storage class
../../src/include/utils/elog.h:242: error: parse error before
"show_funcname"
../../src/include/utils/elog.h:242: warning: type defaults to 'int' in
declaration of 'show_funcname'
../../src/include/utils/elog.h:242: warning: data definition has no type or
storage class
../../src/include/utils/elog.h:255: error: parse error before '}' token
../../src/include/utils/elog.h:255: warning: type defaults to 'int' in
declaration of 'ErrorData'
../../src/include/utils/elog.h:255: warning: data definition has no type or
storage class
../../src/include/utils/elog.h:258: error: parse error before '*' token
../../src/include/utils/elog.h:258: warning: type defaults to 'int' in
declaration of 'CopyErrorData'
../../src/include/utils/elog.h:258: warning: data definition has no type or
storage class
../../src/include/utils/elog.h:259: error: parse error before '*' token
../../src/include/utils/elog.h:261: error: parse error before '*' token
In file included from copydir.c:19:
../../src/include/postgres.h:475: error: parse error before
"assert_enabled"
../../src/include/postgres.h:475: warning: type defaults to 'int' in
declaration of 'assert_enabled'
../../src/include/postgres.h:475: warning: data definition has no type or
storage class
In file included from copydir.c:25:
../../src/include/storage/fd.h:64: error: parse error before "interXact"
../../src/include/storage/fd.h:90: error: parse error before "isCommit"
copydir.c:49: error: parse error before "bool"
copydir.c:50: warning: no previous prototype for 'copydir'
copydir.c: In function 'copydir':
copydir.c:56: error: 'todir' undeclared (first use in this function)
copydir.c:56: error: (Each undeclared identifier is reported only once
copydir.c:56: error: for each function it appears in.)
copydir.c:61: error: 'fromdir' undeclared (first use in this function)
copydir.c:86: error: 'recurse' undeclared (first use in this function)
copydir.c:87: error: 'bool' undeclared (first use in this function)
copydir.c:87: error: parse error before numeric constant
make[2]: *** [copydir.o] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2

Thanks,
Billy Gray

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: William Gray (#1)
Re: BUG #2457: Make fails at copydir.c / copydir.o

"William Gray" <grayw@mail.montclair.edu> writes:

When I run the make for 8.1.4, a number of parse errors are thrown, causing
the build to fail.

The errors suggest some problem with "bool". Do you have any
conflicting #define's for bool in your system headers?

FWIW, 8.1.4 builds fine for me on 10.4.6.

regards, tom lane

#3William Gray
grayw@mail.montclair.edu
In reply to: Tom Lane (#2)
Re: BUG #2457: Make fails at copydir.c / copydir.o

Tom,

I'm not sure how I'd go about determining that. I don't recall messing
with any of my system's .h files. Do you know where I might look?

Thanks!
Billy

Tom Lane wrote:

Show quoted text

"William Gray" <grayw@mail.montclair.edu> writes:

When I run the make for 8.1.4, a number of parse errors are thrown, causing
the build to fail.

The errors suggest some problem with "bool". Do you have any
conflicting #define's for bool in your system headers?

FWIW, 8.1.4 builds fine for me on 10.4.6.

regards, tom lane

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: William Gray (#3)
Re: BUG #2457: Make fails at copydir.c / copydir.o

William Gray <grayw@mail.montclair.edu> writes:

I'm not sure how I'd go about determining that. I don't recall messing
with any of my system's .h files. Do you know where I might look?

grep through all the files under /usr/include looking for "bool" ...

regards, tom lane

#5William Gray
grayw@mail.montclair.edu
In reply to: Tom Lane (#4)
Re: BUG #2457: Make fails at copydir.c / copydir.o

Tom Lane wrote:

William Gray <grayw@mail.montclair.edu> writes:

I'm not sure how I'd go about determining that. I don't recall messing
with any of my system's .h files. Do you know where I might look?

grep through all the files under /usr/include looking for "bool" ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Looks like there are quite a few possible culprits, as it seems to be an
often-defined thing (but I must not shrink from the task...)

c.h defines a bool, and this looks correct and un-tampered with (grep
output)

c.h: * file. Added bool enum from machine/types.h for regular users
c.h: * that want a real boolean type.
c.h:#ifndef bool
c.h:typedef enum { false = 0, true = 1 } bool;
c.h:#endif /* bool */

Both curses.h and ncurses.h appear to use whatever the compiler
considers bool, and if absent, defines their own.

There's a file stdbool.h that may be at fault:

stdbool.h: * $FreeBSD: src/include/stdbool.h,v 1.6 2002/08/16 07:33:14
alfred Exp $
stdbool.h:#define __bool_true_false_are_defined 1
stdbool.h:#define bool _Bool

That is explicitly redefining 'bool' to be of type _Bool.

I feel a little lost here. I'm pretty sure I've never messed with these
files. Is it possible that at some point if I configured some piece of
software with a prefix of /usr that it could have added some header file
to /usr/include that would adversely affect other builds, like postgres?

Thanks for your help,
Bill