From owner-freebsd-arch Thu Feb 28 1:52:18 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 74E3F37B41A; Thu, 28 Feb 2002 01:52:07 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA15829; Thu, 28 Feb 2002 20:52:03 +1100 Date: Thu, 28 Feb 2002 20:52:35 +1100 (EST) From: Bruce Evans X-X-Sender: To: "Brian F. Feldman" Cc: Alfred Perlstein , , Subject: Re: Do we want the _SYS_SYSPROTO_H_ junk? In-Reply-To: <200202272357.g1RNvjY46402@green.bikeshed.org> Message-ID: <20020228202851.X52134-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 27 Feb 2002, Brian F. Feldman wrote: > I want to know if, on new code, we should put them. E.g.: > > #ifndef _SYS_SYSPROTO_H_ > struct open_args { > char *path; > int flags; > int mode; > }; > #endif > int > open(td, uap) > struct thread *td; > register struct open_args /* { > syscallarg(char *) path; > syscallarg(int) flags; > syscallarg(int) mode; > } */ *uap; > { > > The first part, if ever actually called into existence by sysproto.h not > being included, would be bogus. Do we want to keep introducing those? The ifdef'ed version is better, if there is to be one at all, because it can at least in theory be checked automatically (e.g., by not including so that the struct is not declared, but somehow declare the function anyway; then compile and check if the compile worked and gave the same result). The second pseudo-declaration of the struct in the comment is bogus. I removed the comment globally when I implemented , but it came back in a few files in the Lite2 merge. Both versions are really just comments. It can be hard to remember what is in *uap without them. Automatic checking for the ifdefed version would just check the consistency of the comments. Wrong comments for simple things are worse than no comments. The same few files that have syscallarg() in comments also have SCARG() in code. We don't really use either syscallarg() or SCARG(). We just require the MD code to arrange the struct so that ordinary struct member references work right. I would prefer the MD code to push the struct members onto the stack so that no args structs or pseudo-declarations of them are required. I would keep introducing the ifdefed version of the struct while there is still an args struct. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message