Subject: Re: [sv-cc] another directC question - optional formal arg names
From: Francoise Martinolle (fm@cadence.com)
Date: Wed Feb 12 2003 - 12:11:41 PST
Sorry I did not realized that this was possible for extern declarations,
but you are
right, only the data types could be provided.
I do agree with your resolution:
>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.
Francoise
'
At 01:23 PM 2/12/2003 -0500, Andrzej Litwiniuk wrote:
> > >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 - 12:12:35 PST