Maybe it is just our C cross-platform code, but I have found that some
parameters are by value and some by pointer in most routines.  I have not tried
to call printf, etc, as John asked about.

For example, passing a input buffer with its length is typically pointer,
value.  Passing an output buffer is typically pointer, pointer so that the
actual output size can be returned to the caller.

We are not as worried about the standard as that the code compiles cleanly and
executes the same way on all of the supported platforms.

Lloyd



----- Original Message ----
From: Paul Gilmartin <[email protected]>
To: [email protected]
Sent: Fri, October 14, 2011 12:11:53 PM
Subject: Re: Need simple example - Calling c subroutine like printf from
HLASM program

On Oct 14, 2011, at 09:37, Lloyd Fuller wrote:

> You also want to be careful about the parameters.  Some C routines expect
>values
> on the stack (i.e., in-line in the parameter list) and others expect pointers
>to
> the values with most using a mix.  That is typically my problem calling or
> getting called from C:  getting that sequence straight.
>
My understanding is that the C standard calls for all parameters
to be passed by value.  My experience is that IBM's C usually
passes parameters by reference except that if a parameter is a
pointer it gets passed by value.  Go figger.

-- gil

Reply via email to