I wanted to test my notion before presenting it, and it does turn out
that embedding an unreferenced value in a structure (COBOL record) at
least one other element of which is referenced in an executable
statement ensures that that structure will not be deleted.

A PL/I example

declare 1 copyright_block static,
   2 false aligned bit initial('0'b),
   2 true aligned bit initial('1'b),
   2 copyright_text character(38) initial
      ('© copyright 1591 by John Harington, Kt') ;

found = false ;  /* ex hyothesii */
linear_search: do i = lbound(A,1) to h bound(A,1) ;
  . . .
  found = (A(i) = s) ;
  if found then leave ;  /* match? */
  . . .
end linear_search ;

Here the single reference to copyright_block.false in an executable
statement ensures that the structure copyright_block will not be
deleted (or trimmed) by an optimizing compiler.

The same scheme is usable mutatis mutandis in IBM C/C++ and COBOL.


John Gilmore, Ashland, MA 01721 - USA

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

Reply via email to