Varargs in C - (nf)

pedz at smu.UUCP pedz at smu.UUCP
Tue Sep 4 04:18:00 AEST 1984

smu!pedz    Sep  3 13:18:00 1984

RE: William LeFebrev (sp?)  William comments that without passing
some sort of type information, then it is not possible, even when
the number of arguments AND their total size is passed, to determine
the sizes/types of all of the arguments.

You comments are correct but it is possible for the programmer to pass
an additional argument (probably the first) which contains the information
he desires in the format that he feels is best.  For example, printf
passes this information implicitly with the format string.  But
execl does not pass this since it assumes that everything on the stack
is a string.  It only needs the "count" which is done by appending
a trailing zero.  Thus this information is not always needed.

I feel that since the information is not always needed AND it is possible
for the programmer to implement a type passing mechanism (and count) then
it should not be part of the language.

Perry Smith

More information about the Comp.lang.c mailing list