Usability enhancements in Metal C in the latest compiler release
Visda 060001SUB1 Visits (8139)
z/OS V2R3 XL C/C++, IBM Mainframe flagship compiler for IBM Z, was announced this week; with features targetting the latest release of IBM Z, z14, as well as features targetting general application development. A complete list of these features is put together in this compiler's data sheet, and can be found here:
Amongst the zOS V2R3 XL C/C++ new capabilities is the support for a new keyword, __fdptr. This keyword is available for Metal C applications only, and its purpose is to make it possible to call a function as well as make the load module's associated extern and static data available to the caller.
Declaration of such a pointer to, for example, a function that takes two parameters of type int, and returns an int looks like, below:
int (* __fdptr func)(int, int);
To see the significance of the __fdptr keyword, let's take a step back to zOS V1R12 XL C/C++ release of the compiler when support for RENT option was introduced for Metal C. For a system programmer introduction of this feature meant constructing re-enterancy for the user application code. With RENT option the compiler constructed an area of storage, Writeable Storage Area, WSA, and initialized it with extern and static variables, and made the address of this storage area available to all source files in the application code.
A simple example to demonstrate this is:
>cat build.sh #in Unix System Services