From xemacs-m  Tue Feb 18 16:04:51 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
	by xemacs.org (8.8.5/8.8.5) with SMTP id QAA05448
	for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 16:04:50 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id OAA16803 for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 14:04:20 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id OAA18713; Tue, 18 Feb 1997 14:04:15 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id OAA23050; Tue, 18 Feb 1997 14:04:14 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id OAA04540; Tue, 18 Feb 1997 14:04:13 -0800
Date: Tue, 18 Feb 1997 14:04:13 -0800
Message-Id: <199702182204.OAA04540@xemacs.eng.sun.com>
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Hrvoje Niksic <hniksic@srce.hr>
Cc: xemacs-beta@xemacs.org
Subject: Re: 19.15 b94 build failure, solution and subsequent success
In-Reply-To: <kign2t1ajrv.fsf@jagor.srce.hr>
References: <199702181756.MAA02028@verve.canada.sun.com>
	<m2n2t1rj1p.fsf@altair.xemacs.org>
	<199702182111.NAA04397@xemacs.eng.sun.com>
	<kign2t1ajrv.fsf@jagor.srce.hr>
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

>>>>> "Hrv" == Hrvoje Niksic <hniksic@srce.hr> writes:

Hrv> Martin Buchholz <mrb@Eng.Sun.COM> writes:
>> I added
>> #define __EXTENSIONS__ to 20. sol2.h (not sol2-6.h),
>> and changed the gethostname prototype to
>> int gethostname(char *, size_t);
>> in sol2.h.  This should work on any Solaris system.  Georg?

Hrv> Why do you declare the arguments in a function?  The GNU Coding
Hrv> Standards say that, if the function is evil enough to be undeclared,
Hrv> that it's better to just declare the return value.  This is ANSI
Hrv> conformant, and wreaks the least havoc -- I think Stallman is right
Hrv> there.

Hrv> int gethostname();

Hrv> is a declaration that I use in my programs, and it works everywhere.
Hrv> Is there any specific reason why you would want the arguments
Hrv> declared, when compiling with a C compiler?

Some versions of Solaris have no prototype for gethostname, some have
more than one.

I didn't realize that having multiple prototypes

int gethostname();
int gethostname(char *, size_t);

would not elicit a warning either from gcc -Wall or Sun cc -v.

Still, I think my solution for sol2.h is the correct one.  It's better
to have prototypes than not, and there's likely a compiler somewhere
that will issue a warning for the above duplicate prototypes.  And
hopefully Sun's header files won't change again.

Maybe we shouldn't be using gethostname at all, when sysinfo(2) or
uname(2) is available instead?

Martin

