-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Paul Gilmartin
Sent: Monday, September 08, 2014 5:23 PM
To: [email protected]
Subject: Re: Dynalloc with FREE=CLOSE,SPIN=UNALLOC
On Mon, 8 Sep 2014 14:02:17 -0700, Janet Graff wrote:
>By the way this line
>
> ip.__miscitems = &miscitems;
>
>gets a compiler warning for imcompatible pointers. Anyone who can tell me how
>to cast this properly I'll be very grateful.
>
I've been able to do similar with (untried in this case):
* ( int ** ) & ip.miscitems = &miscitems; /* Try casting on the left. */
...
That solution may introduce unnecessary reference-and-dereference instructions,
depending on the optimization level at compile time. I find it far easier to
coerce the subject to the target, in this case with a simple (char **) in ILP32
mode. IMHO that should make the assignment much simpler for the compiler to
generate optimally, and for the next programmer looking at it to decipher.
ip.__miscitems = (char **)&miscitems;
YMMV, and TMTOWTDI.
Peter
--
This message and any attachments are intended only for the use of the addressee
and may contain information that is privileged and confidential. If the reader
of the message is not the intended recipient or an authorized representative of
the intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication
in error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN