On Sun, 2 Apr 2023 22:37:53 +0000, Frank Swarbrick wrote: >I'm just going to put this out there... Dingus has an online test C compiler, >which outputs the generated assembler. You can find it at >http://www.dignus.com/dcc/compileit.html. > Thanks.
>I ran the following program through it. <snip!> > void fun1(tester *, int *); > void fun2(tester, int); > What do you see if you provide actual function bodies, not only prototypes/? ... >Something to note, and it's not supported by C as far as I am aware, is >neither of these are "pass by content". Pass by content is "pass address of a >copy of the field". So a copy is done, as with fun2, but the parameter list >pointed to by R1 is not the address of the copied fields but rather the >address of a parmeter list that contains the addresses of both copied fields. > Are the external semantics (not examining the generated assembly) of "pass by content" any different from "pass by value"? How? It would seem more efficient for the called function to perform the copy rather than the caller because the code to perform the copy would exist only once in the subroutine rather than at each point of call. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN