Pointers must be aligned on 16-byte boundaries in a data-structure, so since
the first subfield is 65 bytes, the RPG compiler adds 15 blank spaces after
that and then aligns the PROCPTR so it starts at position 81.
Either change the order of the fields or (probably easier), make the first
field 64 bytes - that will allow the PROCPTR to start at position 65,
leaving no blank spaces.
On Thu, May 28, 2009 at 9:46 AM, <darren@xxxxxxxxx> wrote:
> I have the below source. I'm trying to design a number of subprocedures
> that will be called in sequence, and checked off interactively in a subfile
> with the results of each call. Now, when I compile this with CRTBNDRPG, I
> see in the compile listing that TLDS is 96 bytes. That indicates that the
> procptr is consuming 31 bytes of storage when I expected 16. The compile
> fails with RNF7303 - Subfield defined with keyword OVERLAY is too big. The
> subfield is TL_p. I can make the TLarr array 96 bytes, but I then get
> Binding errors without much explanation, so I'm not sure what's going on.
> Can I use the extproc keyword on a local subprocedure? If not, is there a
> better way to do this?
> D TLCnt C 1
> Number of tests
> D TLDS DS
> D 65 inz('POSTCV1C - CIC(ICTYP)')
> D * procptr INZ(%paddr('POSTCV1Ca'))
> D TLarr 81 overlay(TLDS) dim(TLCnt)
> D TL 65 overlay(TLarr)
> D TL_p * procptr overlay(TLarr:*next)
> D $VldDta_p S * procptr
> D $VldDta PR like(RtnInd) extproc($VldDta_p)
> D $POSTCV1Ca PR like(RtnInd)