number of arguments function for 4.1bsd VAX cc(1) -- TYPO FIX

H. Morrow Long [Systems Center] long at ittvax.UUCP
Tue Feb 26 05:14:01 AEST 1985


> 
> The following function will return the number of arguments of the function that
> called it.  It works with cc(1) for 4.1bsd running on a Vax.  I can't think of
> any uses for it, but it certainly beats passing an argument telling how many ar-
> guments the function will receive.
> 
> int
> numargs()
> {
>     asm("        clrl    r1");
>     asm("        subb3   8(fp),$92,r1");
>     asm("        ashl    $-2,r1,r0");		/* changed $2 to $-2 */
> }

	You've just set portability back 1,000 years.

-- 

				H. Morrow Long
				ITT-ATC Systems Center,
				1 Research Drive Shelton, CT  06484
				Phone #: (203)-929-7341 x. 634
	
path = {allegra bunker ctcgrafx dcdvaxb dcdwest ucbvax!decvax duke eosp1
	ittral lbl-csam milford mit-eddie psuvax1 purdue qubix qumix 
	research sii supai tmmnet twg uf-cgrl wxlvax yale}!ittvax!long



More information about the Comp.lang.c mailing list