CRE Programmer's Guide
Compiling and Binding Programs for the TNS CRE
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
3-8
Sample Binder Sessions
Section 6, CRE Service Functions, and Section 7, Math Functions. The TNS C, TNS 
COBOL, and FORTRAN run-time libraries call the functions in CRELIB. If you bind the 
appropriate languages’ run-time libraries into your program, you must also bind in 
CRELIB.
Sample Binder Sessions
The following binding example assumes that your program is made up of a TNS C 
object file (CFILE), a TNS COBOL object file (COBFILE), and a TAL object file 
(TALFILE). The C object file uses the wide-memory model in C, and the TAL object file 
contains routines that call CRE library functions.
To create an executable program of minimal size, enter the following Binder 
commands:
ADD * FROM CFILE
ADD * FROM COBFILE
ADD * FROM TALFILE
SELECT SEARCH CWIDE -- Add wide memory-model C library functions
BUILD MyProg
Bind-Time Validation for Mixed-Language Programs
To help you bind mixed-language programs, Binder provides parameter, return-value, 
and language consistency checking.
Parameter and Return-Value Checking
The Binder SELECT CHECK PARAMETER command specifies the extent to which 
Binder checks the consistency of parameters and return value types between called 
and calling routines. 
Binder issues a warning message if the called routine’s parameter requirements do not 
match those of the caller. Because each language has its own set of data types, 
matching parameters and return-value types between languages cannot be exact. To 
reduce the number of extraneous Binder warnings generated when you bind mixed-
language programs, specify the SELECT CHECK PARAMETER STRONG option. (The 
STRONG option is more lenient than the STRICT option.) Under the STRONG option:
•
Formal and actual parameters for intralanguage calls must be the same size, type, 
and mode (passed by value or by reference).
•
Formal and actual parameters for interlanguage calls must belong to the same 
class. The classes of parameters are:
°
Two-byte scalar, passed by value
°
Four-byte integer scalar, passed by value
°
Four-byte real scalar, passed by value
°
Eight-byte integer scalar, passed by value
°
Eight-byte real scalar, passed by value
°
Byte address










