Perhaps write the cleanup function in assembler? This is obviously a trivial
problem in assembler. None of the inconvenience of strong typing to get in
your way LOL.

Charles
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of Bernd Oppolzer
Sent: Monday, March 31, 2014 11:30 PM
To: [email protected]
Subject: Re: Compiler error in z/OS C compiler

Am 01.04.2014 01:16, schrieb Andrew Rowley:
> On 1/04/2014 9:37, Bernd Oppolzer wrote:
>
>> How do you solve the problem that a pointer coming from a PL/1 module 
>> (or ASSEMBLER) and possibly having the high order bit on is not 
>> accepted from the C module as a valid pointer and that the results, 
>> if you use this pointer, are "unpredictable" or "undefined", as 
>> stated by the C manuals? And:
>> if you try to clean the first bit of this pointer by casting it to an 
>> unsigned int and switching the bit off, then you get this logic 
>> removed from the object code by the optimizer, because the optimizer 
>> (of the C compiler) THINKS that a C pointer never has the high order 
>> bit set, so there is no need to execute this logic?

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

Reply via email to