Guardian Application Conversion Guide

Recompiling Your C Program
Converting C Applications
5–2 096047 Tandem Computers Incorporated
Recompiling Your C
Program
Some elements of a C-series C program must be changed if you recompile the program
on a D-series system. To recompile your program, you must:
Compile all program modules with a D-series C compiler
Use the D-series CEXTDECS file (external declarations for Guardian procedures)
Use the D-series ZSYSC file (source declarations for Guardian procedures and
system messages)
Change memory-model file references in SEARCH compiler pragmas
Open temporary files using either the ANSI tempfile function or the Guardian
FILE_CREATE_ procedure
Replace min and max macros
Declare the the NULL macro
Change macro definitions that replace parameters inside a literal string
Specify a FIELDALIGN SHARED2 pragma for type long used in bit-field
declarations
Use the new definition for errno
Change code that relies on the sizeof operator returning 2 for a constant
operand
Change code that relies on size_t, the result of the sizeof operator, being of
type long
Change code that uses the fflush function to flush partial lines to stdout or
stderr
Change code that relies on the return value of the sscanf function
Additional elements of a C-series C program must be changed if you want the
program to be compliant with ANSI C. You do not have to change these elements at
this time. However, Tandem recommends that you change these elements now
because future releases of the Tandem C compiler might not support these elements.
To make your program ANSI C compliant, you must:
Change certain keywords
Replace obsolete TAL function declarations
Declare a function prototype within the scope of each call to a function
These topics are discussed in this subsection.
D-Series and C-Series
Object Modules
You cannot bind modules that have been compiled by a D-series compiler with
modules that have been compiled by a C-series compiler. If you compile any module
with a D-series compiler, you must also recompile any other modules that you bind
with it.