IMHO the problem is:

there are different solutions for variable length parameter lists that are
not compatible.

I don't know about the PL/1 solution. Maybe Steve Comstock can help
us with this.

There are two other solutions, but they don't fit well together:

- the OS/360 solution: the last parameter address has the first bit set.
Note that this solution works only with addresses, that is, call by reference,
and that it requires 31 bit addressing. Parameters passed by value have
a problem, because they can be negative integers, which seems like the
end of the parameter list

- the C solution with stdarg.h. This solution needs a leading fixed number
of arguments; from those fixed arguments, the total number and the types
of the following variable argument list has to be derived (like in printf etc.).
The called function cannot examine the parameter list and recognize
the end of the parameter list, as in the OS solution.

That's IMO the whole dilemma. I don't see any clever solution to this problem,
that is: there will be no solution that works perfectly for all languages.

There are more problems with parameter passing. If you are restricted to
parameter passing mechanisms that work in more than one language
(in our case for example: PL/1, ASSEMBLER, C), you have to be very
restrictive. In our case, for example, we found the following solutions:

- no PL/1 descriptors

- only pointers to structures

- only integer results (returncodes)

- structure definitions generated by central repository, so that there are
no different alignment considerations from the three languages (and all
structure components match)

Kind regards

Bernd



Am 10.04.2012 23:31, schrieb Phil Smith:
Bernd Oppolzer wrote:
I don't know if it helps you, but using C I would code the two calls this way:
rc = THEFUNCTION (&magic, inputbuffer,&inputlength, NULL, NULL);
Exactly backwards-the idea here is to NOT be obscure, but to have a nice, 
flexible, intuitive API. Having to specify null parameters or to use a macro 
for things is what we *don't* want to do.

Thanks though!

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

Reply via email to