[an error occurred while processing this directive]

HP OpenVMS Systems

C Programming Language
Content starts here

Compaq C V6.4 for OpenVMS VAX Release Notes


Previous Contents


/* 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:
  1. Upgrade the system to OpenVMS V6.1 or higher (preferably V6.2 or higher).
  2. 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.
  3. Use /EXTERN_MODEL=STRICT_REFDEF for all modules. This produces the most portable source code.
  4. Use /EXTERN_MODEL=COMMON for all modules.

Previous Contents Contents