Mailing List Archive

solaris 2.5.1 still no good
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi folks,

Here's what I get under solaris 2.5.1 (sparc) with gcc-2.95.2 and
gnumake 3.78-something :

bsd-snprintf.c: In function `msetup':
bsd-snprintf.c:67: warning: implicit declaration of function
`getpagesize'
bsd-snprintf.c:72: `x' undeclared (first use in this function)
bsd-snprintf.c:72: (Each undeclared identifier is reported only once
bsd-snprintf.c:72: for each function it appears in.)
bsd-snprintf.c:72: `y' undeclared (first use in this function)
bsd-snprintf.c:72: warning: left-hand operand of comma expression has
no effect
bsd-snprintf.c: In function `snprintf':
bsd-snprintf.c:123: warning: implicit declaration of function
`vsnprintf'
bsd-snprintf.c: In function `vsnprintf':
bsd-snprintf.c:138: warning: variable `ret' might be clobbered by
`longjmp' or `vfork'
bsd-snprintf.c: At top level:
bsd-snprintf.c:52: warning: `caught' defined but not used
gmake: *** [bsd-snprintf.o] Error 1


I can't find getpagesize() in /usr/include, nor can I find
vsnprintf() or snprintf()

Sorry for using such an old OS ;-)

E.





-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com>

iQA/AwUBOE9o3VJaPnfBnbH/EQLghwCgtpZ/jqRz6nBOfy4q0ZKlntZS9jQAn0Bs
OqmxmtsgU17QHgU/e/x7Rni7
=Xq6G
-----END PGP SIGNATURE-----
Re: solaris 2.5.1 still no good [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 9 Dec 1999, ET wrote:

> Hi folks,
>
> Here's what I get under solaris 2.5.1 (sparc) with gcc-2.95.2 and
> gnumake 3.78-something :
>
> bsd-snprintf.c: In function `msetup':
> bsd-snprintf.c:67: warning: implicit declaration of function
> `getpagesize'

Can anyone offer a replacement for this?

> bsd-snprintf.c:72: `x' undeclared (first use in this function)
> bsd-snprintf.c:72: (Each undeclared identifier is reported only once
> bsd-snprintf.c:72: for each function it appears in.)
> bsd-snprintf.c:72: `y' undeclared (first use in this function)
> bsd-snprintf.c:72: warning: left-hand operand of comma expression has
> no effect

This is weird - it looks like your C compiler is breaking while
trying to expand the roundup() macro.

> bsd-snprintf.c: In function `snprintf':
> bsd-snprintf.c:123: warning: implicit declaration of function
> `vsnprintf'

At least this warning was easily fixed.

> I can't find getpagesize() in /usr/include, nor can I find
> vsnprintf() or snprintf()

There are not #defines which contain the same information?

Regards,
Damien

- --
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE4ULs2ormJ9RG1dI8RAuCnAJ4vFHXo517wc5W+Kq7naZ3KLYoy8wCfTrHW
ClefFOgUKN2lIypIpqK+20A=
=9LxV
-----END PGP SIGNATURE-----
Re: solaris 2.5.1 still no good [ In reply to ]
I just email'd, from my other account, the snprintf.c that we distribute
in PostgreSQL...its been thoroughly tested on all the platforms that we
support, with Solaris 2.5.1 being one of them...the bsd-snprintf.c that we
included in OpenSSH, I believe, was the stock FreeBSD one, whereas this
one is meant to be generic ...

I *believe* that we pulled/borrowed this from sendmail originally...

On Fri, 10 Dec 1999, Damien Miller wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 9 Dec 1999, ET wrote:
>
> > Hi folks,
> >
> > Here's what I get under solaris 2.5.1 (sparc) with gcc-2.95.2 and
> > gnumake 3.78-something :
> >
> > bsd-snprintf.c: In function `msetup':
> > bsd-snprintf.c:67: warning: implicit declaration of function
> > `getpagesize'
>
> Can anyone offer a replacement for this?
>
> > bsd-snprintf.c:72: `x' undeclared (first use in this function)
> > bsd-snprintf.c:72: (Each undeclared identifier is reported only once
> > bsd-snprintf.c:72: for each function it appears in.)
> > bsd-snprintf.c:72: `y' undeclared (first use in this function)
> > bsd-snprintf.c:72: warning: left-hand operand of comma expression has
> > no effect
>
> This is weird - it looks like your C compiler is breaking while
> trying to expand the roundup() macro.
>
> > bsd-snprintf.c: In function `snprintf':
> > bsd-snprintf.c:123: warning: implicit declaration of function
> > `vsnprintf'
>
> At least this warning was easily fixed.
>
> > I can't find getpagesize() in /usr/include, nor can I find
> > vsnprintf() or snprintf()
>
> There are not #defines which contain the same information?
>
> Regards,
> Damien
>
> - --
> | "Bombay is 250ms from New York in the new world order" - Alan Cox
> | Damien Miller - http://www.mindrot.org/
> | Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.0 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE4ULs2ormJ9RG1dI8RAuCnAJ4vFHXo517wc5W+Kq7naZ3KLYoy8wCfTrHW
> ClefFOgUKN2lIypIpqK+20A=
> =9LxV
> -----END PGP SIGNATURE-----
>
>
>

Marc G. Fournier marc.fournier@acadiau.ca
Senior Systems Administrator Acadia University

"These are my opinions, which are not necessarily shared by my employer"
Re: solaris 2.5.1 still no good [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 12 Jan 2000, Ben Taylor wrote:

> It looks like all we have to do for 2.5/2.5.1 support is define
> #define snprintf __snprintf
> #define vsnprintf __vsnprintf

I will integrate tests for the __ functions into configure.in

Damien

- --
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE4fVPhormJ9RG1dI8RAihNAJ9elTgwb29mgVq0V3U2sskDmmwA4wCgqn6x
h1vzZMKTygjIeBceIE90B1I=
=7SFO
-----END PGP SIGNATURE-----
Re: solaris 2.5.1 still no good [ In reply to ]
On Wed, Jan 12, 2000 at 11:18:14PM -0500, Ben Taylor wrote:
8< snip
> I will check my 2.5.1 system tommorow and see what I can do
> about patching. (Anyone got a snippet of Autoconf to
> test various versions of a particular Operating system)
>

I know Damien's handling this now, but just for interest's sake: In
configure.in there's code like this:

*-*-solaris*)
AC_DEFINE(USE_WTMPX)
;;

you'd just need to add something like this:

*-*-solaris*)
AC_DEFINE(USE_WTMPX)
sol_ver=`uname -r`
if test $sol_ver == 5.5 -o test $sol_ver == 5.5.1; then
AC_DEFINE(SOL_25_SNPRINTF_FIX)
fi
;;

(you'll have to check what `uname -r` returns on 2.5.1, though.) You
could do wacky stuff if you need to test for, say, versions less than
2.6:

sol_ver=`uname -r`
sol_major=`echo $sol_ver | awk -F. '{print $1}'`
sol_minor=`echo $sol_ver | awk -F. '{print $2}'`
if test $sol_major -eq 5 -a $sol_minor -lt 6 ; then
do_things
fi

watch those backticks :-)

You could instead add more specific cases instead, e.g.

*-*-solaris2.5)
*-*-solaris2.5.1)
do_things
# fall through
*-*-solaris*)
do_more_things

but that will get messy if there are other special cases for different
versions.


> 8< snip rest

Regs,
-Andre

--
Andre Lucas <andre.lucas@dial.pipex.com>
http://dspace.dial.pipex.com/andre.lucas/
Re: solaris 2.5.1 still no good [ In reply to ]
typo:

On Thu, Jan 13, 2000 at 01:40:21PM +0000, Andre Lucas wrote:
> On Wed, Jan 12, 2000 at 11:18:14PM -0500, Ben Taylor wrote:
> 8< snip
> > I will check my 2.5.1 system tommorow and see what I can do
> > about patching. (Anyone got a snippet of Autoconf to
> > test various versions of a particular Operating system)
> >
>
> I know Damien's handling this now, but just for interest's sake: In
> configure.in there's code like this:
>
> *-*-solaris*)
> AC_DEFINE(USE_WTMPX)
> ;;
>
> you'd just need to add something like this:
>
> *-*-solaris*)
> AC_DEFINE(USE_WTMPX)
> sol_ver=`uname -r`
> if test $sol_ver == 5.5 -o test $sol_ver == 5.5.1; then

remove: ^^^^

-Andre

> AC_DEFINE(SOL_25_SNPRINTF_FIX)
> fi
> ;;
>
> (you'll have to check what `uname -r` returns on 2.5.1, though.) You
> could do wacky stuff if you need to test for, say, versions less than
> 2.6:
>
> sol_ver=`uname -r`
> sol_major=`echo $sol_ver | awk -F. '{print $1}'`
> sol_minor=`echo $sol_ver | awk -F. '{print $2}'`
> if test $sol_major -eq 5 -a $sol_minor -lt 6 ; then
> do_things
> fi
>
> watch those backticks :-)
>
> You could instead add more specific cases instead, e.g.
>
> *-*-solaris2.5)
> *-*-solaris2.5.1)
> do_things
> # fall through
> *-*-solaris*)
> do_more_things
>
> but that will get messy if there are other special cases for different
> versions.
>
>
> > 8< snip rest
>
> Regs,
> -Andre
>
> --
> Andre Lucas <andre.lucas@dial.pipex.com>
> http://dspace.dial.pipex.com/andre.lucas/

--
Andre Lucas <andre.lucas@dial.pipex.com>
http://dspace.dial.pipex.com/andre.lucas/
Re: solaris 2.5.1 still no good [ In reply to ]
On Thu, Jan 13, 2000 at 01:40:21PM +0000, Andre Lucas wrote:
> On Wed, Jan 12, 2000 at 11:18:14PM -0500, Ben Taylor wrote:
> 8< snip
> > I will check my 2.5.1 system tommorow and see what I can do
> > about patching. (Anyone got a snippet of Autoconf to
> > test various versions of a particular Operating system)

> I know Damien's handling this now, but just for interest's sake: In
> configure.in there's code like this:
>
> *-*-solaris*)
> AC_DEFINE(USE_WTMPX)
> ;;
>
> you'd just need to add something like this:
>
> *-*-solaris*)
> AC_DEFINE(USE_WTMPX)
> sol_ver=`uname -r`
> if test $sol_ver == 5.5 -o test $sol_ver == 5.5.1; then
> AC_DEFINE(SOL_25_SNPRINTF_FIX)
> fi
> ;;

Please, please NO, don't do this. Instead, try to find snprintf, and
iff that fails, search for __snprintf. This makes the search more OS
independant, since you're searching for features, not OS characteristics.
(I know, it's a pain. Welcome to autoconf.)

I'm just too used to the Dynix/HP-UX9/SunOS4/etc. days where you had a
soup of "ifdef OS" code that autoconf was designed to fix.

Excuse me, I have to go get depressed about how old that last sentence
makes me sound....

David

--
David W. Rankin, Jr. Husband, Father, and UNIX Sysadmin.
Email: drankin@bohemians.lexington.ky.us Address/Phone Number: Ask me.
"It is no great thing to be humble when you are brought low; but to be humble
when you are praised is a great and rare accomplishment." St. Bernard
Re: solaris 2.5.1 still no good [ In reply to ]
On Thu, 13 Jan 2000, David Rankin wrote:

> Please, please NO, don't do this. Instead, try to find snprintf, and
> iff that fails, search for __snprintf. This makes the search more OS
> independant, since you're searching for features, not OS characteristics.
> (I know, it's a pain. Welcome to autoconf.)

The way I fixed the problem was to add a set of function prototypes
and #defines surrounded by an #ifdef HAVE___SNPRINTF in defines.h
and to #define HAVE_SNPRINTF, HAVE_VSNPRINTF and HAVE___SNPRINTF.
No code outside of defines.h and a single define in config.h
is all that's needed.

> I'm just too used to the Dynix/HP-UX9/SunOS4/etc. days where you had a
> soup of "ifdef OS" code that autoconf was designed to fix.

I understand your pain. I tried to make the fix as elegant as
possible.

Ben
Re: solaris 2.5.1 still no good [ In reply to ]
> Please, please NO, don't do this. Instead, try to find snprintf, and
> iff that fails, search for __snprintf. This makes the search more OS
> independant, since you're searching for features, not OS characteristics.
> (I know, it's a pain. Welcome to autoconf.)

And on how many OSes is __snprintf going to be equivalent to snprintf?

This is what we were talking about before - detect features portably
where useful. If it's a 'platform x is fucked up' hack, treat it as
such. Then, at least it's clear what is going on. In this case, it's
unlikely that you'll find a platform y with the same problem. Why
clutter the code?

You can be over-generic. Look at SGML ;-)

I see your point, but I'm not sure it's always correct to put in generic
detection routines for everything. This is one silly little thing in
Solaris 2.5.x, let it stay there.

-Andre

--
Andre Lucas <andre.lucas@dial.pipex.com>
http://dspace.dial.pipex.com/andre.lucas/
Re: solaris 2.5.1 still no good [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 12 Jan 2000, Ben Taylor wrote:

> It looks like all we have to do for 2.5/2.5.1 support is define
> #define snprintf __snprintf
> #define vsnprintf __vsnprintf

Done.

Regards,
Damien

- --
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE4gQluormJ9RG1dI8RAgl3AKCvoukXc5ec7mbKFcvVMcfg9UN9+ACgz0C7
hoh9VPnqGcxOMn9ofPoxr+E=
=W/9g
-----END PGP SIGNATURE-----