[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



    Default: /NESTED_INCLUDE_DIRECTORY=INCLUDE_FILE
            (current behavior)

    UNIX equivalents:
     -nocurrent_include  /NESTED_INCLUDE_DIRECTORY=NONE


  • /MMS_DEPENDENCY[=(FILE[=filespec] | [NO]SYSTEM_INCLUDE_FILES ,... )] /NOMMS_DEPENDENCY has been added
    The qualifier /MMS_DEPENDENCY tells the compiler to produce a dependency file. The format of the dependency file is similar to that on Digital UNIX.


    
        object_file_name :<TAB><source file name>
    
        object_file_name :<TAB><path to first include file>
        object_file_name :<TAB><path to second include file>
    
    

    The FILE subqualifier specifies where to save the dependency file. The default file extension for a dependency file is .mms. Other than using the different default extension, this qualifier uses the same procedure as /OBJECT and /LIST for determining the name of the output file.
    The SYSTEM_INCLUDE_FILES subqualifier specifies whether or not to include dependency information about system include files. That is, those included with #include <filename>. The default is to include dependency information about system include files.


    
        Default: /NOMMS_DEPENDENCY
    
        UNIX equivalents:
            -M              /MMS_DEPENDENCY=SYS$OUTPUT
            -MD             /MMS_DEPENDENCY
            -MM             /MMS_DEPENDENCY=
                                 (FILE=SYS$OUTPUT,
                                  NOSYSTEM_INCLUDE_FILES)
            default         /NOMMS_DEPENDENCY
    
    

  • /[NO]LINE_DIRECTIVES has been added.
    This qualifier governs whether or not #line directives appear in preprocess output files. Currently, there is no way to specify the form of the line directives. DEC C and C++ always generate the traditional pcc and VAX C form omitting the "line" naming the directive, even in the ANSI modes of the compiler.


    
        Default:    /LINE_DIRECTIVES
    
        UNIX equivalents:
            -P                  /NOLINE_DIRECTIVES
            -E                  /LINE_DIRECTIVES
    
    

  • /COMMENTS=(AS_IS,SPACE) /NOCOMMENTS has been added
    This qualifier governs whether or not comments appear in preprocess output files. If they do not appear, it specifies what replaces them.
    AS_IS specifies that the comment appears in the output file. SPACE specifies that a single space replaces the comment in the output file. /NOCOMMENTS specifies that nothing replaces the comment in the output file. This may result in inadvertent token pasting.
    The C and C++ preprocessor may replace a comment at the end of a line or a line by itself with nothing, even if /COMMENTS=SPACE is specified. Doing so cannot change the meaning of the program.


    
        Default:
            /NOCOMMENTS in the VAXC and COMMON modes of the
                        C compiler
            /COMMENTS=SPACE for C++ and the ANSI modes of
                        the C compiler
            An explicit /COMMENTS on the command line
               defaults to /COMMENTS=AS_IS.
    
        UNIX equivalents:
            -oldcomment         /NOCOMMENTS
            -C                  /COMMENTS=AS_IS
            default             /COMMENTS=SPACE
    
    

  • /[NO]VERSION has been added.
    This is a completely new qualifier intended to make it easier for users to report which compiler they are using.
    This qualifier causes the compiler to print out via printf the compiler version and platform and to exit without performing any other actions. Because of the DCL syntax for the cc command, it is still necessary to specify a source file name. (The null device, NL:, is adequate for this purpose - it is not necessary to have a real source file).
    The compiler version is the same as in the listing file.


    
        Defaults:               /NOVERSION
    
        UNIX equivalents
            -V                  /VERSION
            default             /NOVERSION
    
    

  • #dictionary Support
    The #dictionary directive has been enhanced. The syntax and features are the same as for DEC C V4.0 on OpenVMS/VAX, except that V5.0 will also accept two new keywords, text1_to_array and text1_to_char.


    
     #[pragma] dictionary "pathname" [null_terminate]
                  [name(struct_name)]
                  [text1_to_array | text1_to_char]
    
     pathname: a quoted pathname for a CDD record to be
               extracted
    
     null_terminate: an optional keyword which adds an
               additional byte for the null character
               when a data type of text is extracted
    
     name():   an optional keyword to supply an alternate
               tag name or declarator, struct_name, for the
               outer level of a CDD structure.
    
     text1_to_char: an optional keyword which forces the
               CDD type text to be translated to char,
               rather than array of char if the size is 1.
               This is the default, unless null_terminate
               was specified.
    
     text1_to_array: an optional keyword which forces the
               CDD type text to be translated to type array
               of char, even when the size is 1. This is the
               default when null_terminate is
    specified
    

    7.12 New Features in DEC C V4.0

    Since the field test of DEC C V1.3, the following major new features have been added to DEC C T4.0.

    • DEC C/C++ Run-Time Components Kit
      DEC C requires the DEC C Run-Time Library. This is part of OpenVMS VAX systems V6.0 and later but is not part of OpenVMS VAX V5.5 systems. The DEC C/C++ Run-Time Components Kit makes it possible to install the DEC C Run-Time Library on OpenVMS VAX V5.5 systems, thus allowing DEC C and DEC C++ built applications to run on OpenVMS VAX V5.5 systems.
      See the documentation for the DEC C/C++ Run-Time Components Kit for more information.
    • Builtin Function Support
      DEC C supports the non-privileged builtin functions supported by VAX C. These builtins are:
      _ADAWI
      _BBCCI
      _BBSSI
      _FFC and _FFS
      _INSQHI, _REMQHI, _INSQTI, _REMQTI, _INSQUE, and _REMQUE
      _LOCC
      _MOVC3 and _MOVC5
      _MOVPSL
      _PROBER and _PROBEW
      _SCANC, _SKPC, and _SPANC
      The DEC C User's Guide for OpenVMS Systems describes how to use these builtin functions.
    • The VAX C to DEC C Migration Guide
      This document gives pointers on migrating applications from VAX C to DEC C.
    • DEC C and DEC C++
      DEC C and DEC C++ share a common location for DECC$LIBRARY_INCLUDE. This director contains the header files used by both DEC C and DEC C++. CXX$LIBRARY_INCLUDE contains the header files used only by DEC C++.
      DEC C and DEC C++ share a common startup command procedure, SYS$STARTUP: CCXX$STARTUP. This startup command procedure replaces the older individual startup command procedures.
      DEC C V5.0 and later and DEC C++ V1.3 and later may be installed in either order. The kit installation procedure will not replace header files in DECC$LIBRARY_INCLUDE if they are more recent than those in the kit.
    • SCA support
      Many problems with DEC C's support of the Source Code Analyzer have been fixed.
    • POSIX support
      DEC C supports POSIX for OpenVMS VAX V1.2. See the POSIX documentation for more information.

    7.13 Problems fixed in Compaq C V6.4

    • token-pasting hex constants
      There was a problem using the preprocessor's token-pasting operator with operands consisting of a pp-number containing the letter E or e. In some case the operand would be treated as two separate tokens in modes other than VAXC or COMMON. E.g. in the following example, the initializer for "a" was correct, while the initializer for "b" was expanded to "0x0E a" instead of "0x0Ea".


      #define XXX(xxx) 0x##xxx
      int a = XXX(0Aa);
      int b = XXX(0Ea);
      
    • backslash-newline in COMMON mode
      Under /MODE=COMMON/PREPROCESS_ONLY, the compiler would sometimes recognize a backslash-newline sequence outside of the context of a string literal, a character constant, or a preprocessing directive, and produce an output file reflecting logical line-splicing instead of leaving the backslash-newline sequence intact in the output. This problem has been corrected as shown:


      Input:
          char str1[10] = "A"\
                          "Z";
          char str2[10] = 'A'\
                          'Z';
      Incorrect output for /stand=common/preprocess_only:
          char str1[10] = "A"
                          "Z";
          char str2[10] = 'A'                    'Z';
      Corrected output for /stand=common/preprocess_only:
          char str1[10] = "A"\
                          "Z";
          char str2[10] = 'A'\
                          'Z';
      

    • Incorrect behavior of /PREFIX
      If a qualifier either of the form /PREFIX=RTL= or /PREFIX=EXCEPT= was specified on the command line, then the compiler would erroneously omit prefixing any routines (as if /NOPREFIX had been specified). This behavior was present in all previous versions Compaq C for VAX, and has now been corrected.
    • Compiler failure for long source lines A source line longer than 32767 characters would trigger an internal compiler error. It now will issue a meaningful (but fatal) diagnostic.

    7.14 Problems fixed in Compaq C V6.2

    • excessive compile time for long initializer lists
      Extremely long initializer lists (~100K initializer elements) caused apparent looping in the compiler, which was actually an n**2 algorithm introduced in V6.0 along with initializers with designators. This has been corrected.
    • compiler failure with /SHOW=EXPANSION
      When compiling with /LISTING/SHOW=EXPANSION or -source_listing -show expansion the compiler could accvio if there was a macro which expandanded to a string of 32737 characters or more. The compiler will now truncate the expanded macro text.

    7.15 Problems fixed in DEC C V6.0


    • The preprocessor output of wide-string literals explicitly present in the source failed to include the leading L character, turning them into ordinary string literals when the preprocessed output was compiled.

    7.16 Problems fixed in DEC C V5.7


    • Incorrect optimization comparing an unsigned bit-field consisting of a single bit in the middle of a byte has been fixed. E.g., the following code erroneously printed 1 when compiled with optimization.


      #include <stdio.h>
      static struct {
          unsigned  a : 6;  /* Removing this solves the problem */
          unsigned  b : 1;  /* Changing size to 2 also solves it */
      } x = {0};
      int badproc(void)
      {
          if (x.b > 0)
              return(1);
          else
              return(0);
      }
      int main(int argc, char **argv)
      {
          printf("%d\n", badproc());
          return 0;
      }
      

    • Case EVT102462 is fixed: SCA files for large compilations generated under the /ANALYSIS_DATA qualifier no longer causes SCA-F-NOTERMINATE from the SCA LOAD command when there are more than 65535 SCA events.
    • DEC C now correctly handles array data members of function return results (for functions returning struct or union values). E.g. the following code no longer generates %CC-E-NEEDPOINTER:


        typedef struct {
            struct {
                int field4;
                int field5[10];
            } field3;
        } struct_t;
      
        struct_t return_struct(void);
      
        void foo (struct_t y) {
            int x, z;
            z = y.field3.field5[0];
               /* generate NEEDPOINTER diagnostic below */
            x = return_struct().field3.field5[0];
        }
      

    • In previous compilers, enumeration constants with values beyond the range of type int were silently truncated to int. These now cause a warning to be issued.
    • Certain invalid preprocessing directives could cause an infinite loop in the compiler. E.g. #module 0badident, #include directives with mismatched delimiters.
    • Certain uses of the token-pasting operator to form valid hexadecimal constants were incorrectly treated as errors. E.g., the following produced an error but is now handled correctly:


        #define SVAL(a,b) 0x ## a ## b
        int i = SVAL(23a2,0bae);
      

    • The compiler no longer issues a pointer mismatch warning when a pointer to an array of unqualified element type is passed to a function declared with a parameter declared as a multiply-dimensioned array type with a type qualifier. The warning was erroneous, as the types are compatible under ANSI C. E.g., the following no longer produces a warning:


       extern void func1(const double dbl[][3]);
       void func2(void) {
         double  adPnts[8][3];
      
         func1 (adPnts);
       }
      

    • The compiler now warns when two different names with external linkage in the same compilation are mapped to the same name in the object module (e.g. due to truncation or forcing to monocase).
    • The size of conditional operator (i.e. "?:") expressions was not being computed correctly when the values were character string constants. They were being treated as arrays instead of pointers. E.g. the following produced an error instead of evaluating to the size of a pointer-to-char:


       int is_what;
       int b;
       void f(void)
       {
          b = sizeof(is_what ? "one" : "testing");
       }
      

    7.17 Problems fixed in DEC C V5.6


    • A memory corruption problem within the compiler was fixed. This bug has been present since the first release (V4.0), and could only manifest symptoms under extremely rare circumstances involving the exact number and length of file specifications, the order in which they were processed during early stages of compilation, and the initial state of the runtime heap managed by lib$get_vm. The symptom would typically be a BUGCHECK that would not reproduce when compiling the same source code in a different process environment.
    • A compilation containing an ANSI function prototype for a variable argument list using ellipsis syntax, with a mismatched K&R style definition for that function, provoked the warning "%CC-W-FUNCREDECL, In this declaration, function types differ because one has no argument information and the other has ellipsis". But the compiler then access violated after issuing the warning.
    • Compiler crash and/or memory exhausted system hang using /debug qualifier with #include <exc_handling.h>, or processing any other struct or union type containing a member that is a pointer to a qualified version of the same struct or union type.
    • When compiling a comma-separated list of source files with /list, the listing section containing the values of predefined macros would not be present in the listing files for the second and subsequent compilations. In some cases, the compiler would crash.
    • Compiler would sometimes crash after emitting %CC-W-NOLINKAGE.
    • Under /STAND=VAXC, inform/warn about use of "signed" keyword, which was not supported by VAX C.
    • Compiler would incorrectly use filename information from #line directives to name the object module. Only the primary source file name and #module (#pragma module) directives are supposed to affect the object module name.
    • Permit array indexing operator to be used on an array member within a struct or union that is a function return value. The compiler now correctly handles array data members of function return results for functions returning struct or union values.
    • The /VERSION qualifier no longer creates a 0-length .OBJ file, and it no longer requires a filename to be specified. CC/VERSION (or CC/DECC/VERSION) is sufficient.
    • Fixes to VAXC and MS compatibility modes.
    • Fixes to /ANA processing.

    7.18 Problems fixed in DEC C V5.5

    • The globalvalue extern_model could produce a compiler traceback when an external variable of a struct or other type not supported by globalvalue was encountered. The compiler now produces an appropriate warning message and uses the strict_refdef model for such declarations.
    • SCA typing information for incomplete arrays declared with a typedef declaration were sometimes incorrect and complex declarations caused compile time access violations. Known instances of these problems have been corrected.
    • Placement of certain kinds of pragmas within declarations could cause compiler failures or erroneous .ANA files to be produced uner /ANALYSIS_DATA.
    • Forward declarations involving structure members no longer cause invalid .ANA files to be produced when compiling with /ANALYSIS_DATA
    • Invalid .ANA files are no longer produced when compiling with /ANALYSIS_DATA for source files with code beyond column 256.
    • Better SCA reference information is output for struct declarations and references.
    • Functions with an excessive number of parameters (around 100) will no longer cause the compiler to crash when outputting SCA information. Instead, a warning message is emitted and further parameters will not generate SCA information.
    • Debugger support for pointers to functions has been improved.
    • Improved initialization for redeclared variables. Previously the compiler would not initialize a in the following code


          int a;
          static int a = 1;
      

    • Issue a warning for a cast expression used as an lvalue in strict ANSI mode.
    • A #undef or #define preprocessing directive appearing within the arguments to a function-like macro invocation could cause the compiler to crash (e.g. if it undefined or redefined the function-like macro being invoked). This now produces a warning message.
    • Source files containing very large numbers of #line preprocessing directives could cause a seemingly infinite loop in the compiler due to an n**2 algorithm. The algorithm is now linear.
    • A number of changes have been made to improve compatibility with VAX C, Microsoft C, and UNIX compilers. New messages have been introduced and old ones altered to mimic more accurately the behavior of these other compilers when using the /STANDARD switch. Some of the these compatibility changes are:
      • Do not accept an array of incomplete types.
      • Do not allow constructs like "(z ? x : y).a = 1;"
      • Issue warning for pointer to int assignment.
      • Do not allow pointer types as case constants.
      • Disable processing of type qualifiers after a comma.
      • Handle redeclaration of items with different storage classes.
      • Implement VAX C style unnamed struct/union members in VAXC mode, where the struct/union type of the unnamed member is treated as if it occurred outside of any containing struct/union. In MS mode, the same construct is treated like a C++ unnamed member of union type in C++: the members of the nested struct/union are promoted to the containing struct/union, similar to the behavior of VAXC variant_struct and variant_union constructs.
      • Allow "x->y" under /STAND=VAXC where x is an integer constant or variable.
      • Under /STAND=VAXC, "sizeof(&array)" now returns "sizeof(array)" (i.e. the size of the array object) instead of the size of a pointer (which is what ANSI C requires in this case).
      • Emit meaningful error message for a[b] when both a and b are pointers.
      • Emit informational in VAXC mode for declarations with an explicit "extern" storage class which are also initialized.
      • Issue a warning message for cases like a->b where a is a pointer to an incomplete struct/union.
      • In MS mode, allow an incomplete array type only as the last member in a struct or union. Previously, other incomplete types were accepted, and they were not restricted to the last member.
      • Allow ellipsis in old-style function definitions under /STAND=VAXC.
      • Emit language extension messages for __restrict and __unaligned in /STAND=PORT
      • Improve handling of VAX C storage class modifiers (noshare, readonly, _align) to more closely match the VAX C compiler's behavior.
      • In modes other than VAXC, emit additional diagnostics when a function is redeclared with a different type.
      • Emit new warning message for the long double type on VAX, which does not support long double with greater precision than double.

    7.19 Problems fixed in DEC C V5.3

    This kit contains the following bug fixes beyond those contained in DEC C V5.2:


    • A problem involving, among other factors, the exact lengths of file names processed by the compiler sometimes caused the compiler to bug check. Immediately preceding the bug check was an error message giving the text of a #include directive with no error marker pointing at a location within the directive.
    • V5.2 introduced a bug which caused logical name translation to be applied to the names of text library modules.
    • The /NESTED_INCLUDE=PRIMARY_FILE qualifier was intended to provide behavior compatible with the VAX C compiler. However, the DEC C implementation of this feature on VAX never handled the "sticky defaults" for top-level source files the way that VAX C did (some of the Alpha versions did provide this behavior). In V5.3, both VAX and Alpha interpret this qualifier to produce behavior that is compatible with VAX C.
    • Problems involving the use of variable argument lists (<stdarg.h> or <varargs.h>) were fixed. These involved old-style function parameters of types requiring default argument promotion (now get an E-level diagnostic), and the use of a va_list variable that was not a simple locally-declared variable (now handled correctly).
    • Diagnostic messages containing character constants using a hex escape sequence were being printed with the "x" character omitted.
    • The preprocessor now allows the "defined" operator to be produced as a result of macro expansion. ANSI C does not specify whether or not this should be allowed. Under /standard=ansi89, a warning message is produced when the preprocessor encounters such a construct. In relaxed ANSI an informational is issued instead.
    • Under /stand=vaxc, the type of the sizeof operator is now signed int (matching the behavior of VAX C) rather than unsigned int (which is required by ANSI C).
    • A block-scope extern declaration with incomplete type, with linkage to a file-scope declaration with complete type, "blocked" the completed type information from being available within the scope of that block. This could produce an E-level diagnostic for a correct program such as the following:


          int i[] = {1, 2, 3};
          unsigned int f()
          {
              extern int i[];
              return sizeof(i);
          }
      

    • An initialized globalvalue may now be used as a compile-time constant, just as an enumeration value can be.
    • For a compilation with multiple source files in a comma-list, the module names in the .ana files produced under the /ana qualifier were incorrect for all but the first compilation.
    • Under /standard=vaxc, match the VAX C behavior and accept a sequence of conflicting type specifiers with a warning and use the last one, instead of issuing an E-level diagnostic.
    • Statically initialized data declared with the "const" qualifier was sometimes being placed in the $CODE psect even if it contained address constants that could cause $CODE to become non-sharable. Now this data is placed in a new psect $ADDRESS_DATA so that the $CODE psect will remain sharable.
    • SPR HPAQ628CF: Static initialization using a globalvalue as an initializer produced incorrect initialization if the type of object being initialized was not int (e.g. if it was a char or short type).
    • The compiler now allows an actual argument to a function call to pass the address of a globalvalue; formerly this produced an E-level diagnostic even in VAX C mode. Also changed the mechanism for passing the address of a constant such that if the callee modifies the value it will not affect subsequent calls. This makes the behavior compatible with VAX C.
    • The compiler failed to diagnose an ANSI constraint violation for an old-style function definition with a parameter identifier list, where one of the parameter names matches a visible typedef name.
    • The compiler failed to diagnose use of the name of a variant_struct or variant_union member when constructing the name of a contained member. This is a VAX C feature, and VAX C compiler produces an E-level diagnostic if the name is used in this way.
    • The compiler was incorrectly producing an E-level "invalid declarator" diagnostic when a label was defined with the same name as a typedef. Labels have a separate namespace and should not conflict with other declarations.
    • The compiler would fail if it attempted to output a diagnostic message referring to an unnamed bit field in a struct or union declaration.
    • Under /stand=common, hexadecimal escape sequences (\xnnnn) were being recognized within string literals and character constants. This feature was part of VAX C and ANSI C, but it was not present in "pcc" compilers, and recognizing it under /stand=common produced results that differed from pcc compilers.
    • SPR HPXQ11CEF: Compiler failure when globaldef storage class is applied to a function. The compiler now gives an appropriate E-level diagnostic when globaldef, globalref, or globalvalue storage class is applied to a function.
    • Compiling a function definition that attempts to use a typedef for its function header could either cause a compiler failure or produce an inappropriate diagnostic, e.g.:


          typedef void VFV();
          VFV f;
          VFV f {}
      

      This now produces the correct diagnostic: %CC-E-TYPEDEFFUNC, In this function definition, "f" acquires its type from a typedef.
    • If a globaldef declaration specified a psect name, the psect specification would be ignored if the same variable was previously declared in a globalref declaration.
    • A block-scope declaration with the extern storage class would cause a compiler failure if the identifier being declared matched a visible typedef name declared at file scope.
    • Compiler failure when attempting to output a fatal error message. The following example produced a compiler failure trying to output the fatal error message for include file not found. The root cause involved the specific placement of the pragmas in relation to the declaration:


          struct my_s {
          #pragma message save
          #pragma message disable portable
             int one;
             int two;
      
          #pragma message restore
          };
          #include <i_dont_exist.h>
      

    • When the VAX C "main_program" keyword was used to identify a main program procedure with a name other than "main", the compiler still generated a global procedure named "__MAIN". This made it difficult to put more than one such object module into a single object library. The compiler now makes the "__MAIN" symbol it generates in this case a local symbol.
    • Under /STAND=VAXC, an incompatibility between a function prototype and the corresponding function definition produced only a W-level diagnostic, but calls to such a function were silently ignored by the compiler, causing incorrect behavior at runtime. The diagnostic remains at W-level, but now the generated code is correct.
    • SPR UVO104030: Compiler failure under /preprocess_only when processing a pragma with incorrect syntax.
    • DEC C did not evaluate string literal and character constant hex escape sequences correctly in the /STANDARD=VAXC and /STANDARD=COMMON modes of the compiler. Note that hex escape sequencences are not supported in common mode.


    Previous Next Contents