|
Compaq C V6.4 for OpenVMS VAX Release Notes
/* relaxed, strict_refdef --> definition */
int global_var=1;
|
When modules A and B were linked together on a pre-V6.1 VAX system, the
linker failed to treat the declaration of
global_var
in A.C as a reference to the definition of
global_var
in B.C. Instead, references to
global_var
in A.C used the address zero. No linker messages were produced, and an
executable would ACCVIO when
global_var
was referenced. This problem can be worked around by using one of
the following techniques:
- Upgrade the system to OpenVMS V6.1 or higher (preferably V6.2 or
higher).
- When using /EXTERN_MODEL=RELAXED_REFDEF (this is the default),
declare all external references using the keyword
extern
, and only have a single declaration as the definition that lacks the
keyword
extern
or initializes the variable.
- Use /EXTERN_MODEL=STRICT_REFDEF for all modules. This produces the
most portable source code.
- Use /EXTERN_MODEL=COMMON for all modules.
|