Thread: pg7.3b5 on cygwin 1.3.15-1 - Same error

pg7.3b5 on cygwin 1.3.15-1 - Same error

From
"Henshall, Stuart - Design & Print"
Date:

Using:
$ uname -a
CYGWIN_98-4.10 BX3551_TC 1.3.15(0.63/3/2) 2002-11-06 22:41 i686 unknown
I still get the error below on building 7.3b5. I thought Jason had entered a patch to cygwin to fix it. Am I just imagining things, or did it just not get applied for some reason?

Cheers,
- Stuart
gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../src/i
nclude  -DBUILDING_DLL  -c -o heaptuple.o heaptuple.c -MMD
In file included from ../../../../src/include/c.h:56,
                 from ../../../../src/include/postgres.h:48,
                 from heaptuple.c:21:
/usr/include/stdio.h:207: parse error before '(' token
/usr/include/stdio.h:207: `off_t' redeclared as different kind of symbol
/usr/include/cygwin/types.h:29: previous declaration of `off_t'
/usr/include/stdio.h:207: parse error before "int"
/usr/include/stdio.h:208: parse error before "ftell"
In file included from /usr/include/sys/stat.h:26,
                 from /usr/include/sys/fcntl.h:164,
                 from ../../../../src/include/c.h:68,
                 from ../../../../src/include/postgres.h:48,
                 from heaptuple.c:21:
/usr/include/cygwin/stat.h:71: parse error before "off_t"
/usr/include/cygwin/stat.h:78: parse error before '}' token

Re: pg7.3b5 on cygwin 1.3.15-1 - Same error

From
"Dave Page"
Date:
Hi Stuart,
 
Jason did submit a patch, but I don't know how long it takes for one to get into Cygwin. I don't have it to hand, but if you check the archives you can hack stdio.h to get round the problem in the meantime.
 
Regards, Dave.
-----Original Message-----
From: Henshall, Stuart - Design & Print [mailto:SHenshall@westcountry-design-print.co.uk]
Sent: 08 November 2002 09:25
To: pgsql-cygwin@postgresql.org
Subject: [CYGWIN] pg7.3b5 on cygwin 1.3.15-1 - Same error

Using:
$ uname -a
CYGWIN_98-4.10 BX3551_TC 1.3.15(0.63/3/2) 2002-11-06 22:41 i686 unknown
I still get the error below on building 7.3b5. I thought Jason had entered a patch to cygwin to fix it. Am I just imagining things, or did it just not get applied for some reason?

Cheers,
- Stuart
gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../src/i
nclude  -DBUILDING_DLL  -c -o heaptuple.o heaptuple.c -MMD
In file included from ../../../../src/include/c.h:56,
                 from ../../../../src/include/postgres.h:48,
                 from heaptuple.c:21:
/usr/include/stdio.h:207: parse error before '(' token
/usr/include/stdio.h:207: `off_t' redeclared as different kind of symbol
/usr/include/cygwin/types.h:29: previous declaration of `off_t'
/usr/include/stdio.h:207: parse error before "int"
/usr/include/stdio.h:208: parse error before "ftell"
In file included from /usr/include/sys/stat.h:26,
                 from /usr/include/sys/fcntl.h:164,
                 from ../../../../src/include/c.h:68,
                 from ../../../../src/include/postgres.h:48,
                 from heaptuple.c:21:
/usr/include/cygwin/stat.h:71: parse error before "off_t"
/usr/include/cygwin/stat.h:78: parse error before '}' token

Re: pg7.3b5 on cygwin 1.3.15-1 - Same error

From
Jason Tishler
Date:
Stuart,

On Fri, Nov 08, 2002 at 09:59:32AM -0000, Dave Page wrote:
> Jason did submit a patch, but I don't know how long it takes for one
> to get into Cygwin. I don't have it to hand, but if you check the
> archives you can hack stdio.h to get round the problem in the
> meantime.

Although my patch was accepted, it did *not* make it into Cygwin
1.3.15-1.  If you (temporarily) remove the following from stdio.h:

    int _EXFUN(fseeko, (FILE *, off_t, int));
    off_t   _EXFUN(ftello, ( FILE *));

then pg7.3b5 should build cleanly.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: pg7.3b5 on cygwin 1.3.15-1 - Same error

From
Peter Eisentraut
Date:
Jason Tishler writes:

> Although my patch was accepted, it did *not* make it into Cygwin
> 1.3.15-1.  If you (temporarily) remove the following from stdio.h:
>
>     int _EXFUN(fseeko, (FILE *, off_t, int));
>     off_t   _EXFUN(ftello, ( FILE *));
>
> then pg7.3b5 should build cleanly.

I have looked at your previous posts about this but I still don't
understand the root cause of this problem.  How widespread are the
affected Cygwin versions (mine doesn't appear to be affected), and how
often are we going to have to deal with this report?

--
Peter Eisentraut   peter_e@gmx.net


Re: pg7.3b5 on cygwin 1.3.15-1 - Same error

From
Jason Tishler
Date:
Peter,

On Sat, Nov 09, 2002 at 05:28:08PM +0100, Peter Eisentraut wrote:
> Jason Tishler writes:
> > Although my patch was accepted, it did *not* make it into Cygwin
> > 1.3.15-1.  If you (temporarily) remove the following from stdio.h:
> >
> >     int _EXFUN(fseeko, (FILE *, off_t, int));
> >     off_t   _EXFUN(ftello, ( FILE *));
> >
> > then pg7.3b5 should build cleanly.
>
> I have looked at your previous posts about this but I still don't
> understand the root cause of this problem.

The root cause is the following:

    o In some recent version of Cygwin, the above two lines were added
      to stdio.h.
    o Recently, the HAVE_FSEEKO ifdef was added to pg_config.h.in.

> How widespread are the affected Cygwin versions

I don't know, but it will be fixed in Cygwin 1.3.16.

> and how often are we going to have to deal with this report?

Ditto.

I hope you realize that I have done all I can to solve this problem.
Once Dave brought it to my attention, I tracked down the root cause,
devised a solution, and submitted the appropriate patch.  Note that I
have no control as to when (or even if) my Cygwin patches will be
accepted and applied.

> (mine doesn't appear to be affected),

BTW, what version of Cygwin are you running?

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: pg7.3b5 on cygwin 1.3.15-1 - Same error

From
Peter Eisentraut
Date:
Jason Tishler writes:

> The root cause is the following:
>
>     o In some recent version of Cygwin, the above two lines were added
>       to stdio.h.
>     o Recently, the HAVE_FSEEKO ifdef was added to pg_config.h.in.

That doesn't explain why the PostgreSQL build would fail.  Is fseeko
detected when it shouldn't have been, or vice versa?  These would be
PostgreSQL and/or Autoconf problems, and I'd like to understand them so
they can be fixed at the right place.  Adding a few things to a few
headers files shouldn't cause things to blow up.

--
Peter Eisentraut   peter_e@gmx.net


Re: pg7.3b5 on cygwin 1.3.15-1 - Same error

From
Jason Tishler
Date:
Peter,

On Sun, Nov 10, 2002 at 01:43:09PM +0100, Peter Eisentraut wrote:
> Jason Tishler writes:
> > The root cause is the following:
> >
> >     o In some recent version of Cygwin, the above two lines were
> >       added to stdio.h.
> >     o Recently, the HAVE_FSEEKO ifdef was added to pg_config.h.in.
>
> That doesn't explain why the PostgreSQL build would fail.

Sorry for the above weak explanation, but I was extremely limited on
time when I posted it.  I will try again.

> Is fseeko detected when it shouldn't have been, or vice versa?

Yes, but I consider this a Cygwin bug and not a PostgreSQL autoconf
issue because Cygwin:

    o defines fseeko() and ftello() in stdio.h
    o contains the code for fseeko() and ftello() in cygwin1.dll
    o does *not* export fseeko() and ftello() from cygwin1.dll

Hence, IMO, Cygwin is inconsistent with its treatment of fseeko() and
ftello() and confuses PostgreSQL's configure.  The following trivial
Cygwin patch which just exports fseeko() and ftello():

    http://cygwin.com/ml/cygwin-patches/2002-q4/msg00042.html

corrects the problem.

> These would be PostgreSQL and/or Autoconf problems, and I'd like to
> understand them so they can be fixed at the right place.

I think that Cygwin is the right place to correct this problem.
Otherwise, many application including PostgreSQL will have to fix this
problem over and over again.

> Adding a few things to a few headers files shouldn't cause things to
> blow up.

Agreed, but remember that this is Windows. :,)  It seems like the
following lines in pg_config.h:

    #define fseeko(a, b, c) fseek((a), (b), (c))
    #define ftello(a) ftell((a))

conflict with the following lines in stdio.h:

    int _EXFUN(fseeko, (FILE *, off_t, int));
    off_t   _EXFUN(ftello, ( FILE *));

Unfortunately, I couldn't figure out why.  You are certainly welcome to
do so yourself.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6