On 2014-09-08 15:35, Farley, Peter x23353 wrote:
> 
>    *  ( 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.
>  
I don't recall why I chose that.  It may have been my unfamilarity
with C (not much better nowadays), coupled with (I remember clearly)
the original open source author's casting an L-value, accepted by
most compilers but prohibited by ANSI and by IBM.  It may have been
buried in macros, making the straightforward solution harder.

-- gil

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

Reply via email to