on the fringe of C syntax/semantics

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Wed Oct 11 03:31:53 AEST 1989


In article <457 at usage.csd.unsw.oz>, troy at mr_plod.cbme.unsw.oz (Troy Rollo) writes:
|  From article <789 at crdos1.crd.ge.COM>, by davidsen at crdos1.crd.ge.COM (Wm E Davidsen Jr):
|  
|  davidsen>   If I understand the question, you want (int(*)())
|  
|  Nope - bracketing only works when you have something to group with. that will
|  produce exactly the same results as (int *())

In the original question some aspect of varargs was being questioned, in
which the argument in question is used as a cast. This is how a cast
works:
	(int (*)())	cast X into pointer to function returning int
	(int *())	cast X into function returning pointer to int

I realize that the macro may not be identical on all systems, but I
*thought* that's what the std said, a type, formatted to be used as a
cast. Used *as I indicated* the expressions do not have the same effect
at all and I'm not sure that the 2nd is legal, casting something to be a
function???
-- 
bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon



More information about the Comp.lang.c mailing list