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

c89(1) OSS Shell and Utilities Reference Manual
Dynamic and Static Linking
The -WBdllsonly and -WBdynamic flags specify dynamic linking. The -WBstatic flag specifies
static linking. In dynamic linking:
The nld utility first searches for a shared run-time library (SRL). If an SRL cannot be
found, nld then searches for an archive file. If neither of these files are found, an error is
issued. In static linking, nld searches for an archive file but does not search for an SRL.
The ld or 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 an SRL or
DDL or an archive, but static linking accepts only an archive.
Unlike other c89 flags, multiple -WBdllsonly, -WBdynamic, and -WBstatic flags can be
specified in a single c89 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 c89 affect linking arguments
specified in -Weld, -Weld_obey, -Wld, -Wnld, -Wld_obey,or-Wnld_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, ld,ornld flags that control linking within the
argument list. All linkers perform dynamic linking by default. Refer to the eld(1), ld(1),or
nld(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).
c89 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
c89.
Thus,
the Guardian file system file $VOL.SUBVOL.FILEC, which identifies a C source file, is
specified to c89 as /G/VOL/SUBVOL/FILE.c. Likewise, c89 generates an object file
$VOL.SUBVOL.FILEO that can be specified to c89 again as /G/VOL/SUBVOL/FILE.o.
The default executable object file when the current working directory is in the Guardian file sys-
tem is aout.
Predefined Preprocessor Symbols and Macros
c89 defines the following preprocessor symbols and feature-test macros:
__cplusplus
Directs the preprocessor to process the source text as C++ source code. c89 defines
this symbol if the -Wcplusplus flag is specified or the name of an OSS source file ends
in a C++ suffix (.ii, .C, .cpp, .c++, .cxx, .cc, .eC, .ecpp, .ec++, .ecc,or.ecxx).
_TANDEM_SOURCE
Makes visible to the preprocessor identifiers required or permitted by extensions made
by HP. c89 defines this feature-test macro if the -Wextensions flag is specified.
224 Hewlett-Packard Company 527188-021