Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

c99(1) OSS Shell and Utilities Reference Manual
Libraries can be:
Archives, with a suffix of .a
DLLs, with a sufx of .so
The default executable file in the Guardian file system is aout in the subvolume from which c99
is invoked.
If only a single source file is given and no flags that suppress linking are specified, then the file is
compiled into an object file and linked into an executable object file. If the executable le is
created successfully, the object file is removed.
c99 places object files (loadfiles) in the current working directory with the same base name as the
corresponding source file, but with a suffix of .o.
c99 also names several temporary or intermediate files that are created during the compilation
process. Like the output object file, c99 places these files in the current working directory. c99
removes these temporary or intermediate files unless the -Wsavetemps flag is specified.
If -Wsystype=oss is set, the C and C++ compilers define the predefined feature-test macros
_OSS_TARGET and _XOPEN_SOURCE.If-Wsystype=guardian is set, the C and C++ com-
pilers define the predefined feature-test macros _GUARDIAN_TARGET and
_TANDEM_SOURCE. These macros are used in the standard header files to determine the exe-
cution environment of a program. The feature-test macros can also be defined with a -D flag.
Because these macros are defined internally, not by c99, the macros are not defined when
-Wdryrun or -Wv are used.
Dynamic and Static Linking
The -WBdllsonly and -WBdynamic flags specify dynamic linking. The -WBstatic flag specifies
static linking. In dynamic linking, the eld utility first searches for a dynamic-link library (DLL).
If a DLL cannot be found, the linker then searches for an archive file. If neither of these files are
found, an error is issued. In static linking, the linker searches for an archive file but does not
search for a DLL.
If the archive file cannot be found, an error is issued.
Dynamic and static linking are not exact opposites. Dynamic linking accepts either a DDL or an
archive, but static linking accepts only an archive.
Unlike other c99 flags, multiple -WBdllsonly, -WBdynamic, and -WBstatic flags can be
specified in a single c99 invocation. Thus, it is possible to perform dynamic linking for some -l
operands and static linking for others.
The -WBdllsonly, -WBdynamic, and -WBstatic flags specified to c99 affect linking arguments
specified in -Weld,or-Weld_obey flags. Each specification remains in effect until another is
encountered. To change how a linker performs linking for such arguments, you can specify eld
flags that control linking within the argument list. All linkers perform dynamic linking by
default. Refer to the eld(1) reference page for more information.
Handling of Files in the Guardian File System
Files
in the Guardian file system can be accessed using OSS pathname syntax
(/G/volume/subvol/fileID).
c99 requires that files in the Guardian file system be identified with a suffix as is done in the OSS
file system. Because Guardian filenames do not allow the .sufx format, the period is dropped
and the suffix becomes the last character of the filename. However, the .sufx format must be
used when specifying the file to c99.
Thus, the Guardian file system file $VOL.SUBVOL.FILEC, which identifies a C source file, is
specified to c99 as /G/VOL/SUBVOL/FILE.c. Likewise, c99 generates an object file
254 Hewlett-Packard Company 527188-021