WHAT DOES NARGS() DO?

Frank Adams franka at mmintl.UUCP
Thu May 1 09:51:19 AEST 1986


In article <289 at brl-smoke.ARPA> gwyn at BRL.ARPA writes:
>nargs() was suppressed about the time of 7th Edition UNIX (1978)
>and should not be used for anything these days.  It returned the
>actual argument count, for use in functions taking a variable
>number of arguments.  If nargs() had to be supported, it would
>have an impact on the run-time architecture; many of those now
>in use simply cannot support nargs().

This is not strictly speaking true.  You could have a convention whereby
the number of arguments was always pushed on the stack or left in a
register or something.  This would mean that supporting nargs would
put a burden (time and space) on a program compiled with the compiler.
This is definitely not a good idea.

Frank Adams                           ihnp4!philabs!pwa-b!mmintl!franka
Multimate International    52 Oakland Ave North    E. Hartford, CT 06108



More information about the Comp.lang.c mailing list