At 08:37 AM 9/8/2001 -0700, Gurusamy Sarathy wrote:
>On Wed, 05 Sep 2001 15:58:39 BST, Graham Barr wrote:
>>On Wed, Sep 05, 2001 at 07:35:53AM -0700, Gurusamy Sarathy wrote:
>>> On Tue, 04 Sep 2001 21:51:29 CDT, "Craig A. Berry" wrote:
>>> >>needs s/Perl_pp_rand/*(PL_ppaddr[OP_RAND])/ or similar.
>>> [...]
>>> >- pp_rand();
>>> >+ *(PL_ppaddr[OP_RAND]);
>>>
>>> I think you'll find that the parens at the end are needed.
>>> C ain't Perl! :)
>>
>>Thats what I thought. But it worked both ways.
>
>Whoa, is this a new gcc extension that I'm ignorant of? It certainly
>ain't what ANSI ordained.
This was just a haste-driven goof on my part, and when the compiler took it
without complaint I didn't give it any more thought. Clearly we do need the
parens, and what happens when they aren't there is only a matter of curiosity.
>This code compiles (with a warning in most places) but will not
>actually call the function using any of the C compilers I have
>tried (that includes gcc 2.95.x).
<test program snipped>
The example compiles without complaint on Compaq C 6.4, even with strict
ANSI enabled. A bit odd, since this is usually a very fussy compiler. When
I generate an assembly listing, it appears to load the address of the
routine in a register but never does anything with it.