Am 31.03.2023 um 02:12 schrieb Frank Swarbrick:
Because of the linkage pragma that specifies "OS" I imagine that, although the C code is 
defined as "pass by value", the OS linkage overrides it to be passed by reference.  Just 
a guess; I don't have a C compiler.

this is true ... see my other post.

This means that _printf4 cannot by called by a "normal" C program,
if this #pragma linkage(...,OS) is not present at the caller's side

Maybe others have other impressions about the C implementation,
because they regularly use this #pragma linkage or because they use a startup macro
which does it under the cover. We don't ...

I saw the "by value" behaviour which I described in detail, when I looked almost every day at dumps of C programs in the 1990s. It was crucial when debugging C programs on the mainframe at that time to be able to read the parameters which are passed between C functions ... and there were lots of functions passing there parameters by value. Internal C functions, but they produced normal save area chains, and it was no problem to walk thru the chains and find the parameters
at every call level ...

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to