Open System Services Programmer's Guide

The c89 or c99 utility is used to compile and link OSS programs. Example 4 compiles but does
not link the source file gprog.c with a SYSTYPE of GUARDIAN.
Example 4 Specifying the systype Option to the c89 Utility
$ c89 -c -Wsystype=guardian gprog.c
The result of Example 4 is an object file named gprog.o. Example 5 compiles the main OSS
program and links it with the Guardian C module object file into an executable program file named
outfile.
Example 5 Linking Guardian Modules to OSS Programs
$ c89 -o outfile gprog.o ossprog.c
The operations shown in Example 4 and Example 5 cannot be combined into one c89 command.
You must use two c89 commands, because you cannot compile two modules with different systype
values in the same c89 command.
For some basic examples of how to use the c89 and c99 utilities, see “Using the Development
Tools” (page 43) and for more detail, refer to C/C++ Programmer’s Guide and to the c89(1) or
the c99(1) utility reference page either online or in the Open System Services Shell and Utilities
Reference Manual.
Refer to Bits From Left to Right
When using OSS functions, you set the values of parameters, options, flags, and fields instead of
referring to values by their bit numbers within fields. When using Guardian procedures, sometimes
you must refer to a particular bit in a field by its number. For example, to open an OSS file using
its pathname with a Guardian procedure, you set bit 10 of the options parameter of the
FILE_OPEN_ procedure to 1.
Remember that NonStop software refers to bits from left to right, which means that bit 0 is the
leftmost bit in a field.
Using the Development Tools
This subsection describes the programming development tools available to you from the OSS and
Guardian environments, including editors, development utilities, compilers, linkers, optimizers,
debuggers, and performance analyzers.
Using Tools in Both Environments
You can edit, compile, link, and optimize programs to run in either the OSS or Guardian target
execution environment from either development environment. While it is easier in most cases to
use OSS tools to develop applications to run in the OSS target execution environment, there are
some cases in which you will want to use Guardian tools. Also, there are some tools that can run
only from the Guardian environment, such as the TEDIT editor or the Measure performance analyzer.
Multiple Windows
Maintaining two windows open to the same NonStop system, one with a TACL prompt and one
with an OSS shell prompt, lets you move easily between the Guardian and OSS environments.
For example, you can write, compile, and test programs with OSS tools in the OSS environment
and move to the TACL prompt to debug programs and analyze performance. For information on
running Open System Services, see the Open System Services User’s Guide.
Using the Development Tools 43