Avoiding Pitfalls in Multi-Language Programming

other language. In the called routine, declare the data as a
record/structure with data items that
correspond to those for the Fortran or Basic common block.
Compilation Options
General:
Frequently, we forget to use the simple compiler options available that provide very useful
information
for program debugging. TABLE or MAP options can
provide symbol lists with type, size, and
alignment information. Range checking may be activated for development
testing. Automatic
initialization may be selected to avoid
those nasty undefined value problems in FORTRAN via the
$INIT option.
If Shared Globals are used extensively, the
default limit on the number of global data references of
approximately 2000 may be reached. This limit may be removed
with the recently introduced compiler
options of $MORE_GLOBALS
for Pascal, $CONTROL MOREGLOBALS for Cobol, and the +k
pragma for C.
C:
#pragma HP_ALIGN allows you to control the alignment of structure members.
The +u option instructs the compiler to assume that pointers may point to objects that are half-word
aligned, and generate code accordingly. This will degrade
performance and is not recommended if it
can be avoided.
Cobol:
$CONTROL OPTFEATURES=CALLALIGNED flags any parameters not on a 32-bit boundary.
$CONTROL OPTFEATURES=LINKALIGNED improves
performance of a Cobol subprogram. Use
only if you know that every parameter passed to the subprogram will be 32-bit aligned.
$CONTROL SYNC16 causes the SYNCHRONIZED clause to align on 16-
bit boundaries.
$CONTROL SYNC32 restores the default, 32-bit alignment.
Transact:
The Transact PROCINTRINSIC option must be
used to call an intrinsic when the intrinsic is not
declared with DEFINE(INTRINSIC). If this option is not used, the
Transact compiler downshifts any
procedure names not found in the SYSINTR.PUB.SYS file which may result in the procedure
name
not being found.
Link Editor Considerations
General:
Dependent libraries
Dependent libraries will soon be supported on a MPE/iX post-
5.0 release. This
enhancement will allow a list
of library dependencies to be associated with a library.
When the library is loaded, its dependent libraries are also
loaded. This allows the
dependencies to be isolated within the libraries themselves; only the first-
level libraries
need to be specified when linking or running the program.
Parameter type checking
Page
7
of
14
Avoiding Pitfalls in Multi
-
7/18/2008
http://www.hp.com/cgi
-
bin/pf
-
new.cgi?IN=http://jazz.external.hp.com/papers/lang/pgm_pi
...