From xemacs-m  Tue Feb 18 19:29:10 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 TAA09674
	for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 19:29:09 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id RAA11787 for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 17:28:40 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id RAA08603; Tue, 18 Feb 1997 17:28:36 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id RAA05931; Tue, 18 Feb 1997 17:28:36 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id RAA04865; Tue, 18 Feb 1997 17:28:32 -0800
Date: Tue, 18 Feb 1997 17:28:32 -0800
Message-Id: <199702190128.RAA04865@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: <kighgj9afd5.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>
	<199702182204.OAA04540@xemacs.eng.sun.com>
	<kighgj9afd5.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 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.

Hrv> Remember, C is not C++!  An empty prototype means only that you don't
Hrv> know the parameters at the time.  I think the compilers are correct
Hrv> not to warn in that case.

Being able to build XEmacs someday with a C++ compiler is not
unreasonable.

And soon, C will be C++--.  From the C9X standards committee plans:

  Implicit function definition removed
  Disallow implicit int in declarations
  Disallow implicit int in old-style parameters
    Just what they say, functions must have a prototype, variables and
    parameters must be declared with a type.

>> Still, I think my solution for sol2.h is the correct one.

Hrv> Well... :-)

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

Hrv> gethostname is an interface to uname(2) on many implementations.

uname() is documented in POSIX, while gethostname is not.  POSIX says
uname() returns an 8 byte name on many implementations, while
gethostname() is often limited to 31 bytes.  On Solaris, either will
return up to 256 byte names.  Solaris implementors clearly expect
users to use uname().

Martin

