Re: lib/csu cleanup #2 - review please (commit candidate)

Mark Murray <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
> > 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:

<bde>
> 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).
</bde>

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 [email protected]
with "unsubscribe freebsd-audit" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.