From owner-freebsd-current Sun Aug 18 7:12:54 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E948437B400 for ; Sun, 18 Aug 2002 07:12:52 -0700 (PDT) Received: from optima-hyper.com (s2.optima-inc.us [12.111.39.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E49043E4A for ; Sun, 18 Aug 2002 07:12:52 -0700 (PDT) (envelope-from yuri@tsoft.com) Received: from s1.optima-inc.us (s1 [12.111.39.155]) by optima-hyper.com (8.12.5/8.12.2) with ESMTP id g7IECgDI027328; Sun, 18 Aug 2002 10:12:42 -0400 (EDT) Received: from tsoft.com (localhost [127.0.0.1]) by s1.optima-inc.us (8.12.5/8.12.2) with ESMTP id g7IECZWS000503; Sun, 18 Aug 2002 10:12:41 -0400 (EDT) Message-ID: <3D5FAB64.AFF2CAA9@tsoft.com> Date: Sun, 18 Aug 2002 10:12:52 -0400 From: Yuri Victorovich X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: David Malone , current@FreeBSD.ORG Subject: Re: libwrap bug? References: <3D5F28BF.EE86E5AB@tsoft.com> <20020818085452.GA80443@walton.maths.tcd.ie> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG David, > A fucntion which is declared with no arguments (eg sock_host()) > is assumed to be a function defined in the K&R way. Argument number > and types don't need to be known. To decalre a function which takes > no arguments (and which has an ANSI style definition) you say > "function(void)". So this prototype is correct because the definition > in socket.c is a K&R definition. Such K&R way to declare functions sounds like an open invitation for bugs. > > MySQL on Alpha gives "unaligned access..." > > error because they use it w/out an argument and > > actual libwrap expects an argument. > > The bug would seem to be calling sock_host without an argument. C++ complains if function was declared K&R style and used correctly. So I had to change those declarations in tcpd.h to compile correctly. > I've been considering adding ANSI prototypes to tcpd.h, so we > get more useful warnings from it. Yes, please add them! Right now MySQL calls functions the wrong way but due to the specifics of i386 assembly they get away with this. Since compiler pushes this argument to stack before calling them for some function following later on. So they use it as if it was theirs )) And Alpha code is built differently so this bug comes up. Regards, Yuri. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message