Re: [sv-cc] another directC question - optional formal arg names


Subject: Re: [sv-cc] another directC question - optional formal arg names
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Wed Feb 12 2003 - 10:23:22 PST


> >For external functions the names of formal arguments are optional (while they
> >are obligatory for native subroutines - let me enjoy this long forgotten
> >term).
FRANCOISE:
> I do not understand: in C it is not possible to call a C function with
> argument name passing,
> everything is by position even for varargs.
> this brings another issue, do we allow directC function to take varargs?

The names of formal arguments are optional in the external definitions
in Verilog. For example, all the following external definitions are equivalent
and legal in DirectC:

extern void foo(int i, bit b);
extern void foo(int , bit b);
extern void foo(int i, bit );
extern void foo(int , bit );

> >It won't make any sense to have the names of formal arguments only for some
> >of them and still use passing by name.
FRANCOISE:
> not understanding

Passing arguments by names makes sense for the declaration "foo(int i, bit b)"
but not for "foo(int i, bit)" or "foo(int, bit)".

So the following rule may be proposed: passing by name may be used for
a call of an external function only if all formal arguments of that
function do have names.

Andrzej



This archive was generated by hypermail 2b28 : Wed Feb 12 2003 - 10:24:06 PST