Thread: SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile...

SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile...

From
Vadim Mikheev
Date:
src/backend/libpq/pqcomm.c:

> socket-flock.patch
>
>       use advisory locks to check if the unix socket can be deleted.
>       A running postmaster keeps a lock on that file. A starting
>       postmaster exits if the file exists and is locked, otherwise
>       it deletes the sockets and proceeds.
>       This avoid the need to remove manually the file after a postmaster
>       or system crash.
>       I don't know if flock is available on any system. If not we could
>       define a HAVE_FLOCK set by configure.

flock() is not standard call - imho, fcntl() should be used...

---

src/backend/port/snprintf.c:

snprintf.c:84: structure has no member named `_flags'
snprintf.c:84: `__SWR' undeclared (first use this function)
snprintf.c:84: (Each undeclared identifier is reported only once
snprintf.c:84: for each function it appears in.)
snprintf.c:84: `__SSTR' undeclared (first use this function)
snprintf.c:85: structure has no member named `_bf'
snprintf.c:85: structure has no member named `_p'
snprintf.c:86: structure has no member named `_bf'
snprintf.c:86: structure has no member named `_w'
snprintf.c:89: structure has no member named `_p'
               ^^^^^^^^^
This is about FILE structure...
BSD code was used for snprintf.c, but
FILE in BSD is not the same as in SunOS 5.5.1...

Vadim

Re: [HACKERS] SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile...

From
David Hartwig
Date:

Vadim Mikheev wrote:

> src/backend/port/snprintf.c:
>
> snprintf.c:84: structure has no member named `_flags'
> snprintf.c:84: `__SWR' undeclared (first use this function)
> snprintf.c:84: (Each undeclared identifier is reported only once
> snprintf.c:84: for each function it appears in.)
> snprintf.c:84: `__SSTR' undeclared (first use this function)
> snprintf.c:85: structure has no member named `_bf'
> snprintf.c:85: structure has no member named `_p'
> snprintf.c:86: structure has no member named `_bf'
> snprintf.c:86: structure has no member named `_w'
> snprintf.c:89: structure has no member named `_p'
>                ^^^^^^^^^
> This is about FILE structure...
> BSD code was used for snprintf.c, but
> FILE in BSD is not the same as in SunOS 5.5.1...

I have the same problem on my AIX box.    , Linux includes snprint as in the
stdio library.

I would prefer to drop snprintf altogether, and replace it with sprintf and a
sufficient buffer.   The places where snprintf is used are logically bound to
string lengths less than 64 bytes.   Otherwise, snprintf becomes another
porting issue.    I have no idea how to ( or wheather I can) implement this
using vprintf.    The flags and data structures are very different.



Re: [HACKERS] SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile...

From
The Hermit Hacker
Date:
On Fri, 4 Sep 1998, David Hartwig wrote:

> Vadim Mikheev wrote:
>
> > src/backend/port/snprintf.c:
> >
> > snprintf.c:84: structure has no member named `_flags'
> > snprintf.c:84: `__SWR' undeclared (first use this function)
> > snprintf.c:84: (Each undeclared identifier is reported only once
> > snprintf.c:84: for each function it appears in.)
> > snprintf.c:84: `__SSTR' undeclared (first use this function)
> > snprintf.c:85: structure has no member named `_bf'
> > snprintf.c:85: structure has no member named `_p'
> > snprintf.c:86: structure has no member named `_bf'
> > snprintf.c:86: structure has no member named `_w'
> > snprintf.c:89: structure has no member named `_p'
> >                ^^^^^^^^^
> > This is about FILE structure...
> > BSD code was used for snprintf.c, but
> > FILE in BSD is not the same as in SunOS 5.5.1...
>
> I have the same problem on my AIX box.    , Linux includes snprint as in the
> stdio library.
>
> I would prefer to drop snprintf altogether, and replace it with
> sprintf and a sufficient buffer.  The places where snprintf is used
> are logically bound to string lengths less than 64 bytes.

    snprintf() has become very popular in dealing with buffer overrun
security holes, at least that's where I've seen it most.  Solaris 2.6 does
have snprintf, whereas 2.5.1 doesn't...

> Otherwise, snprintf becomes another porting issue.  I have no idea how
> to ( or wheather I can) implement this using vprintf.  The flags and
> data structures are very different.

    I'm grabbing a different snprintf()...just looked through
sendmail's conf.c file, which has an snprintf() implementation in there
that looks more "Generic"...its not GPLd, so is safe to integrate...

    Watch the commit messages...



Re: [HACKERS] SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile...

From
Bruce Momjian
Date:
>
>
> Vadim Mikheev wrote:
>
> > src/backend/port/snprintf.c:
> >
> > snprintf.c:84: structure has no member named `_flags'
> > snprintf.c:84: `__SWR' undeclared (first use this function)
> > snprintf.c:84: (Each undeclared identifier is reported only once
> > snprintf.c:84: for each function it appears in.)
> > snprintf.c:84: `__SSTR' undeclared (first use this function)
> > snprintf.c:85: structure has no member named `_bf'
> > snprintf.c:85: structure has no member named `_p'
> > snprintf.c:86: structure has no member named `_bf'
> > snprintf.c:86: structure has no member named `_w'
> > snprintf.c:89: structure has no member named `_p'
> >                ^^^^^^^^^
> > This is about FILE structure...
> > BSD code was used for snprintf.c, but
> > FILE in BSD is not the same as in SunOS 5.5.1...
>
> I have the same problem on my AIX box.    , Linux includes snprint as in the
> stdio library.
>
> I would prefer to drop snprintf altogether, and replace it with sprintf and a
> sufficient buffer.   The places where snprintf is used are logically bound to
> string lengths less than 64 bytes.   Otherwise, snprintf becomes another
> porting issue.    I have no idea how to ( or wheather I can) implement this
> using vprintf.    The flags and data structures are very different.

Agreed.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)