varargs fails on typedefs
Brett Galloway
brett at wjvax.UUCP
Fri Aug 1 02:45:39 AEST 1986
In article <2640 at brl-smoke.ARPA> version B 2.10.3 4.3bsd-beta 6/6/85; site wjvax.wjvax.UUCP wjvax!qubix!saber!sun!decwrl!pyramid!hplabs!tektronix!uw-beaver!cornell!rochester!seismo!lll-crg!caip!brl-adm!brl-smoke!smoke!rbj at icst-cmr rbj at icst-cmr (Root Boy Jim) writes:
>> This makes the typedef completely useless.
>Only for varargs use. You can always have *two* typedefs, one for
>definitions, and one for argument declarations. I know, yuk!
>> To fix this problem, I propose a promote() operator, as follows:
>Clearly, as you say, there is no way to emulate this. On the other hand,
>this is done so rarely as to be tolerated the way it is. Do you really
>want to muck up the language with rarely used constructs?
>
>As a side issue, routines requiring varargs are frowned on anyway.
This is probably a question of varargs' role more than anything else. I find
varargs useful, and therefor use it. When I do, I find the restriction that
the user know about argument type promotion annoying, especially since the
compiler knows about type promotion already.
Apparently, you find varargs a kludge (you frown on it), and so label an
enhancement to C that would generalize variable argument parsing
"mucking up" the language.
Presumably, since varargs is being standardized (as stdarg), the X3J11
committee finds it to be a feature and not a kludge. In that case, now
is the time to generalize the stdarg interface, and that requires (a)
new operator(s) in C.
--
-------------
Brett Galloway
{pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett
More information about the Comp.lang.c
mailing list