Re: 'C' Operators precedence

Ville Voutilainen (kernel@cook.ml.org)
Thu, 21 May 1998 00:31:36 +1000 (EST)


On Wed, 20 May 1998, Richard B. Johnson wrote:

> On Tue, 19 May 1998, Todd Larason wrote:
>
> > But, um, it doesn't. Assuming 'f' is a simple variable, not a more
> > complicated expression, that could just be
> > r = f(a);
> >
>
> I am going to answer this thread only once.
>
> Read a text like:
> C:Step-by-Step, Waite & Prata, The White Group, Howard W Sams Publ.
> ISBM 0-672-22651-0
> Page 500, 14.2
> Quote "
> pfun = atof;
> you can use this call to invoke the atof() function:
> (*pfun)(string);
> Some C compilers have allowed the following usage when pfun is a
> pointer.
> pfun(string) /* rogue usage */
> Note:Neither ANSI C nor K&R C supports this form.
> " End quote.

It's a pity your book is wrong.

The left argument of the function call operator is explicitly
specified as being a pointer to function in section 6.3.2.2 of the
ANSI C standard. In the normal case of calling a function by it's
name the function name is automatically converted to a pointer to that
function (section 6.2.2.1).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu