Installation guide
7.4.3 Differences Between DIGITAL UNIX C and DEC C
When you compile an application on a DIGITAL UNIX system that is
compiled with DEC C on an ULTRIX system, you should notice few
differences in how the program is compiled. Both compilers comply with the
ANSI C language definition. However, you might notice some differences
that result from implementation-specific features, standards-compatible
extensions, or differences in interpretations of the ANSI standard.
To minimize the effect of any differences, use the DIGITAL UNIX C
compiler option that offers the most compatibility, as shown in Table 7–4.
Table 7–4: Compilation Options that Are Compatible with DEC C
If You Use This ULTRIX Option Use This DIGITAL UNIX Option
Default (ANSI C with a few
compatible extensions)
−std (ANSI C with a few compatible extensions.
Some differences exist between this mode and
the c89 default mode.)
−std (Strict ANSI) −std1 (Strict ANSI.)
−common (K&R C)
Default (−std0, which is K&R C with a few
ANSI extensions.)
−vaxc
No equivalent.
a
a
For information about migrating applications written in the VAX C programming language on ULTRIX,
see Section 7.4.5.
The following list describes some differences you might notice between the
DIGITAL UNIX C compiler and the DEC C compiler:
• The DIGITAL UNIX C compiler supports function inlining when you
use the −O3 option. Function inlining eliminates the overhead
associated with calling a procedure and allows the compiler to apply
general optimization methods across functions.
The DEC C compiler also supports function inlining; however, that
compiler uses a heuristic approach to performing the inline expansion
of function calls.
Because of this implementation difference, the −noinline option has a
different effect on DIGITAL UNIX and ULTRIX systems. The option
has no meaning on a DIGITAL UNIX system, unless you also specify
the −O3 option. With DEC C, the option applies any time you use it.
• The DIGITAL UNIX C compiler does not support using #pragma
directives to control function inlining; that is, the compiler does not
support the following DEC C syntax:
#pragma inline ( function_name
[[, function_name...]] )
#pragma noinline ( function_name
[[, function_name...]] )
7–28 Migrating Your ULTRIX Application to a DIGITAL UNIX System