Installation guide
7.4.5 Differences Between DIGITAL UNIX C and VAX C (vcc)
Software
If you compile an application you wrote for the cc compiler on VAX
ULTRIX systems with the DIGITAL UNIX C compiler, you might notice
some differences in how the compilers operate. Some of these differences
are hardware specific, others are differences in how the compilers are
implemented.
To minimize the effect of these differences, use the DIGITAL UNIX C
compiler option that offers the most compatibility, as shown in Table 7–6.
Table 7–6: Compilation Option for Compatibility with VAX C Software
If You Use This ULTRIX Option Use This DIGITAL UNIX Option
Default (VAX C on ULTRIX) Default (−std0)—K&R C with ANSI
extensions. Some differences exist due to
differences between VAX and RISC systems
and differences between the compilers.
The following list details the differences between the DIGITAL UNIX C
compiler when you use the −std0 option and the vcc command:
• The pointers on RISC systems are unsigned; on VAX systems they are
signed.
• On RISC systems, you cannot dereference NULL pointers, including
arguments to the strlen function.
• The varargs function on RISC systems is different from that function
on VAX systems. Your application will fail if it walks an argument list
by incrementing the address of an argument, particularly if the
arguments are double-precision values. Use the macros in varargs.h
when you use functions that have a variable number of arguments.
Compiling with the −varargs option on RISC systems causes the
compiler to detect nonportable code.
• The setjmp/longjmp buffer is larger on RISC systems than on VAX
systems. Programs with a hard-coded, 10-word buffer fail; applications
that include setjmp.h and declare a variable of type jmp_buf work
correctly.
• RISC systems define a macro (for example, LANGUAGE_C) for the
preprocessor that makes it possible to write multilingual include files.
• The −Md or −Mg option is not needed when on RISC systems. The
software supports only one double-precision format.
• The DIGITAL UNIX C compiler does not support the following VAX C
keywords:
7–32 Migrating Your ULTRIX Application to a DIGITAL UNIX System