From owner-freebsd-audit Thu Jul 4 3:56: 6 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A702637B400 for ; Thu, 4 Jul 2002 03:56:02 -0700 (PDT) Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.139.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id C52B143E3B for ; Thu, 4 Jul 2002 03:56:00 -0700 (PDT) (envelope-from mark@grimreaper.grondar.org) Received: from storm.FreeBSD.org.uk (uucp@localhost [127.0.0.1]) by storm.FreeBSD.org.uk (8.12.5/8.12.5) with ESMTP id g64AtqCE009043; Thu, 4 Jul 2002 11:55:52 +0100 (BST) (envelope-from mark@grimreaper.grondar.org) Received: (from uucp@localhost) by storm.FreeBSD.org.uk (8.12.5/8.12.5/Submit) with UUCP id g64AtpOE009042; Thu, 4 Jul 2002 11:55:51 +0100 (BST) Received: from grimreaper.grondar.org (localhost [127.0.0.1]) by grimreaper.grondar.org (8.12.5/8.12.5) with ESMTP id g64ApNii029382; Thu, 4 Jul 2002 11:51:23 +0100 (BST) (envelope-from mark@grimreaper.grondar.org) Message-Id: <200207041051.g64ApNii029382@grimreaper.grondar.org> To: Bruce Evans Cc: audit@FreeBSD.ORG Subject: Re: lib/csu cleanup #2 - review please (commit candidate) References: <20020704192057.V21375-100000@gamplex.bde.org> In-Reply-To: <20020704192057.V21375-100000@gamplex.bde.org> ; from Bruce Evans "Thu, 04 Jul 2002 19:33:21 +1000." Date: Thu, 04 Jul 2002 11:51:22 +0100 From: Mark Murray Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > Because I could see no reason to clutter the file with unused > > structure declarations, just so that unused arguments could be > > instantiated. Call it a code cleanup. The code has been verified > > to work in a make world. > > Hrmph. My review said that the i386 code should probably be changed > to be more like the alpha code here, not the reverse. There are no > varargs functions here. Declaring and implementing a non-varargs > function as varargs gives machine-dependent breakage, e.g., passing > the args in the wrong place on only some machines. Your review was Hard To Read(tm), and explained how things worked, without really giving a particularly strong direction for how things should proceed. Quoted: > Why do we need to rename "arguments"? Presumably for consistency with the other crt1.c's. But ap is not a very good name, sepecially here -- it often means the varargs pointer, but that is not what it (starts as) here. The code uses a hand rolled version of va_arg() to handle "...". That probably wouldn't work on more complicated arches. The corresponding alpha code doesn't even use "...". That is more correct, since we don't have a normal varargs setup (which might have some args in registers) -- we have an array of "char **"'s which has been initialized using suword() to write a long into each char ** (this all assumes that longs can hold "char **"'s, and some other things. I'm surprised it works for i386's with 64-bit longs). Distilling: o "ap" is not a very good name. o code uses hand-rolled va_arg() equivalent code that may not work on other (nonexistent) arches. o alpha may be more correct Questions: o if the alpha method is more correct, what are the needed i386 changes to remove the '...'? o What is so important about these unused argments anyway? o What could be done to make all the crt1.c's the same? M -- o Mark Murray \_ O.\_ Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message