This thread has drifted horribly -- or wonderfully, if you prefer.

Returning to the original question, everything I know about PL/I could be
engraved on the head of a pin, but the thought occurred to me: why shoehorn
this problem into a language where it does not seem to fit? Why not write a
function directly in PL/I something like

IF ARG = NULL then RETURN SYSNULL ELSE RETURN ARG;

?

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of Bernd Oppolzer
Sent: Thursday, March 27, 2014 8:51 AM
To: [email protected]
Subject: Compiler error in z/OS C compiler

Hello mainframe C users,

today I observed an error in the C compiler, which made me think again about
the optimization strategy of the z/OS C compiler.

I wrote a small C function; the purpose was to translate pointer values
coming from PL/1 modules from NULL() values
- PL/1 builtin NULL() yields 0xFF000000 - to "real" NULLs
- 0x00000000 - or PL/1 SYSNULL.

This is what I did:


/**********************************************************/
/* */
/*   PLI/1 NULL () => SYSNULL ()                          */
/* */
/**********************************************************/

static void *pli_null_to_sysnull (void *ptr)

{
    unsigned int ppli = (unsigned int) ptr;

#ifdef COMPERR
    printf ("Ausgabe in pli_null_to_sysnull "
            "wg. Comp-Fehler: %x\n", ppli); #endif

    if (ppli == 0xff000000u)
    {
       return NULL;
}
    else
    {
       return ptr;
    }
}

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

Reply via email to