On Fri, 24 Aug 2012 10:13:21 -0400, Thomas David Rivers wrote:
>
>As Gil mentioned - this is only "really" true for static data... extern data 
>can't be trusted
>because the user might have put the 'const' keyword in one declaration, and 
>left it off in
>another... which would mean that the extern reference might be a RENT one, 
>while, say,
>the definition was non-RENT.
> 
ANSI seems to allow this as long as no translation unit modifies
the data.  Otherwise the effect is undefined.  So a conforming
implementation is free to put the object in write-protected
storage.  S0C4 fits within the notion of "undefined".

>In your situation - where you are declaring a large array of doubles - putting 
>the data
>in non-RENT memory can be a big win.
>
"non-RENT"?  ITYM "RENT" so it doesn't get copied.

>This is only supported by the assumption that if the programmer says "const" - 
>he really
>means it... that's the point of the ROCONST option in the IBM compiler.   So, 
>you can say
>"oh - I guess the programmer didn't _really_ mean it".
> 
I would hate to have to support such misbehavior.  But, I suppose,
"The customer is always right."

This is reminiscent of the OS's not loading modules marked REFR
into write-protected storage because so many programmers
"didn't _really_ mean it"  I think that's been fixed.  Installation
option?  REFRPROT comes to mind.

-- gil

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

Reply via email to