vaxckitsrc CC — VMS C_2.3
The CC command invokes the VAX C compiler to compile C source
programs.
CC file-spec,... +library-file-spec/LIBRARY...
Additional information available:
Command ParametersQualifiersErrorsLanguage topicsLink libraries
Run-time functions
/ANALYSIS_DATA/CROSS_REFERENCE/DEBUG/DEFINE/DIAGNOSTICS
/G_FLOAT/INCLUDE_DIRECTORY/LIBRARY/LIST/MACHINE_CODE
/OBJECT/OPTIMIZE/PRECISION/SHOW/STANDARD
/UNDEFINE/WARNINGS
Command Parameters
file-spec,...
One or more VAX C source files separated by plus signs or
commas. If plus signs are used, the input files are
concatenated into a single object file. If commas are used,
each file is compiled separately to create separate object
files. If no input file extension is specified, VAX C assumes
the .C default file extension.
library-file-spec
A text library containing #include modules referenced in one or
more of the source files. A library file specification must be
concatenated with a file specification with a plus sign and
qualified by /LIBRARY. If the input file extension is not
specified, VAX C assumes the .TLB default file extension.
Qualifiers
Indicate special actions to be performed by the compiler or special
input file properties. Compiler qualifiers can apply to either the
CC command or to the specification of the file being compiled.
When a qualifier follows the CC command, it applies to all the
files listed. When a qualifier follows the file specification, it
applies only to the file immediately preceding it.
The following list shows all the qualifiers available with the CC
command:
o /[NO]ANALYSIS__DATA[=file-spec]
o /[NO]CROSS__REFERENCE
o /[NO]DEBUG[=(options,...)]
o /[NO]DEFINE=(identifier[=definition][,...])
o /[NO]DIAGNOSTICS[=file-spec]
o /[NO]G_FLOAT
o /[NO]INCLUDE__DIRECTORY=(pathname [,pathname...]]
o /LIBRARY
o /[NO]LIST[=file-spec]
o /[NO]MACHINE_CODE[=option]
o /[NO]OBJECT[=file-spec]
o /[NO]OPTIMIZE
o /PRECISION={SINGLE,DOUBLE}
o /SHOW
o /STANDARD=[NO]PORTABLE
o /[NO]UNDEFINE=(identifier[,...])
o /[NO]WARNINGS[=option]
/ANALYSIS_DATA [=file-spec]
/NOANALYSIS_DATA[=file-spec]
Controls whether the compiler generates a file of source code
analysis information. The default file name is the file name of
the primary source file; the default file type is .ANA.
/CROSS_REFERENCE
/NOCROSS_REFERENCE (D)
Specifies whether the compiler is to generate cross-references. If
you specify /CROSS_REFERENCE, the compiler lists, for each variable
referenced in the procedure, the line numbers of the lines on which
the variable is referenced. You must use the /CROSS_REFERENCE
qualifier with either the /SHOW=SYMBOLS or the /SHOW=BRIEF
qualifiers. To obtain any type of listing, you must specify /LIST.
/DEBUG[=(options,...)] (D=TRACEBACK)
/NODEBUG
Requests that information be included in the object module for use
with the VAX Symbolic Debugger. You can select the following
options:
ALL Include all possible debug information
NONE Do not include any debugging information
NOTRACEBACK Do not include traceback records
TRACEBACK Include only traceback records
If you use /DEBUG without specifying and option, the default is
/DEBUG=ALL.
/DEFINE=(identifier[=definition][,...])
/NODEFINE (D)
/DEFINE performs the same function as the #define preprocessor
directive. That is, /DEFINE defines a token string or macro to be
substituted for every occurrence of a given identifier in the
program.
DCL converts all input to uppercase unless it is enclosed in
quotation marks.
The simplest form of a /DEFINE definition is
/DEFINE=true
This results in a definition like the one that would result from
#define TRUE 1
Macro definitions must be enclosed in quotation marks as seen in
the definition
/DEFINE="funct(a)=a+sin(a)"
This definition produces the same results as
#define funct(a) a+sin(a)
When more than one /DEFINE is present on the CC command or in a
single compilation unit, only the last /DEFINE is used.
When both /DEFINE and /UNDEFINE are present in a command line,
/DEFINE is always evaluated before /UNDEFINE.
The default is /NODEFINE.
/DIAGNOSTICS[=file-spec]
/NODIAGNOSTICS (D)
The qualifier /DIAGNOSTICS creates a file containing compiler
messages and diagnostic information. The default file extension
for a diagnostics file is ".DIA". The diagnostics file is
primarily for use with DIGITAL's layered products which flag errors
in source code files.
/G_FLOAT
/NOG_FLOAT (D)
Control the format of floating-point variables. When /G_FLOAT is
not specified, double variables are represented in D-float format.
When /G_FLOAT is specified, all variables declared as double are
represented in G-float format. A program compiled with /G_FLOAT
must be linked with the G-float library, VAXCRTLG.OLB. This
library must be specified so that it is searched before
VAXCRTL.OLB.
/INCLUDE_DIRECTORY=(pathname [,pathname...]]
/NOINCLUDE_DIRECTORY (D)
Provides an additional level of search for user-defined include
files. Each pathname argument can be either a logical name or a
legal directory specification, in quoted form.
The /INCLUDE_DIRECTORY qualifier provides the functionality of the
-i qualifier in PCC on ULTRIX. This qualifier allows you to
specify additional directories to search for include files. The
forms of inclusion are the #include "file-spec" and #include
<file-spec> forms. For the quoted form, the order of search is as
follows:
1. The directory containing the source file.
2. The directories specified in the /INCLUDE qualifier (if any).
3. The directory or search list of directories specified in the
logical name C$INCLUDE (if any).
For the bracketed form, the order of search is as follows:
1. The directories specified in the /INCLUDE qualifier (if any).
2. The directory or search list of directories specified in the
logical name VAXC$INCLUDE (if any).
3. If VAXC$INCLUDE is not defined, then the directory or search
list of directories specified by SYS$LIBRARY.
/LIBRARY
Indicates that the associated input file is a library containing source text modules specified in #include directives. The compiler searches the specified library for all #include module names that are not enclosed in angle brackets or quotation marks. The name of the library must be concatenated with the file specification using a plus sign. Example: CC DATAB/LIBRARY+APPLIC
/LIST[=file-spec] (Batch default)
/NOLIST (Interactive default)
Controls whether a listing file is produced. The default output
file extension is .LIS.
/MACHINE_CODE[=option]
/NOMACHINE_CODE (D)
Controls whether the listing produced by the compiler includes the
machine language code generated during the compilation. If you use
this qualifier you also need to use /LIST.
The three options are as follows:
AFTER The machine code produced during compilation prints
after the source code listing.
BEFORE The machine code prints before the source code
listing.
INTERSPERSED The lines of machine code print alternately with the
lines of source code.
The default option is INTERSPERSED.
/OBJECT[=file-spec] (D)
/NOOBJECT
Controls whether the compiler produces an output object module.
The default output file extension is .OBJ.
/OPTIMIZE [=NODISJOINT] (D)
/NOOPTIMIZE
Controls whether optimization is performed by the compiler.
/PRECISION={SINGLE,DOUBLE)
/PRECISION=DOUBLE (D)
Controls whether floating-point operations on float variables are
performed in single or double precision.
/SHOW=(option,...) D=(SOURCE)
This qualifier is used with /LIST to set or cancel specific listing
options:
ALL Print all listing information
BRIEF Prints a brief symbol table, listing only those
identifiers that are referenced in the program.
[NO]DICTIONARY Print/do not print Common Data Dictionary
definitions (D = NODICTIONARY)
[NO]EXPANSION Print/do not print macro expansions (D =
NOEXPANSION)
[NO]INCLUDE Print/do not print contents of #include files (D
= NOINCLUDE)
[NO]INTERMEDIATE Print/do not print intermediate macro expansions
(D = NOINTERMEDIATE)
NONE Print no listing information
[NO]SOURCE Print/do not print source file statements (D =
SOURCE)
[NO]STATISTICS Print/do not print compiler performance
statistics (D = NOSTATISTICS)
[NO]SYMBOLS Print/do not print symbol table (D = NOSYMBOLS)
[NO]TERMINAL Display/do not display compiler messages at the
terminal. If NOTERMINAL is specified, only the
summary message is displayed. (D = TERMINAL)
[NO]TRANSLATION Display/do not display the translation of a UNIX*
system file specification to a VAX/VMS file
specification. (D = NOTRANSLATION)
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
/STANDARD=[NO]PORTABLE (D=NOPORTABLE)
Specifies whether the compiler is to generate warning messages to flag VAX C specific constructs and deviation from conventional C constructs and rules (PORTABLE), or not to generate such messages (NOPORTABLE). The default is /STANDARD=NOPORTABLE.
/UNDEFINE=(identifier[,...])
/NOUNDEFINE (D)
/UNDEFINE performs the same function as the #undef preprocessor
directive. That is, it cancels a macro definition.
The /UNDEFINE qualifier is useful for undefining the predefined VAX
C preprocessor constants. For example, if you use a preprocessor
constant (such as vaxc, VAXC, VAX11C, or vms) to conditionally
compile segments of VAX C specific code, you can undefine constants
to see how the portable sections of your program execute. An
example of this is
/UNDEFINE="vaxc"
When both /DEFINE and /UNDEFINE are present on the command line,
/DEFINE is always evaluated before /UNDEFINE.
The default is /NOUNDEFINE.
/WARNINGS[=option] (D=/WARNINGS)
/NOWARNINGS
Controls whether the compiler prints warning diagnostic messages,
informational diagnostic messages, neither, or both. The two
options are as follows:
NOINFORMATIONALS
NOWARNINGS
The /WARNINGS qualifier alone forces the compiler to print both
informationals and warnings (the same as if no qualifier were used
on the command line). The /NOWARNINGS qualifier forces the
compiler to suppress both informationals and warnings. The
/WARNINGS=NOINFORMATIONALS qualifier forces the compiler to
suppress the informationals. The /WARNINGS=NOWARNINGS qualifier
forces the compiler to suppress warnings.
Errors
VAX C compiler error messages.
Additional information available:
ANACHRONISMARGLISTOOLONGARGOVERFLOWBADCODE
BADPSECTBITARRAYBITFIELDSIZEBOUNDADJUSTEDBUGCHECK
CASECONSTANTCDDATTRIGNOREDCDDTOODEEPCMPLXINIT
COLMAJORCOMPILERRCONFLICTDECLCRXCONDITION
DEFTOOLONGDIVIDEZERODUPCASEDUPDEFAULT
DUPDEFINITIONDUPLABELDUPMAINFUNCDUPMEMBER
DUPPARAMETERENUMCLASHENUMOPEXTRACOMMA
EXTRAFORMALSEXTRAMODULEEXTRATEXTFATALSYNTAX
FILENOTFOUNDFLOATCONFLICTFLOATOVERFLOWFUNCNOTDEF
GLOBALENUMIFEVALERRORIFNOMACSUBIFSYNTAX
IGNOREDINSBEFOREINSMATCHINTVALERRORINTVALREQ
INVAGGASSIGNINVALIDIFINVALIGNSPECINVALINITINVANAFILE
INVANAFILEINVARRAYBOUNDINVARRAYDECLINVASSIGNTARG
INVBREAKINVCMDVALINVCONDEXPRINVCONSTINVCONTINUE
INVCONVERTINVDEFNAMEINVDICTPATHINVFIELDSIZE
INVFIELDTYPEINVFILESPECINVFUNCDECLINVFUNCOPTION
INVHEXCHARINVHEXCONINVIFNAMEINVLINEFILE
INVLINELINEINVMAINRETVALINVMODIDENTINVMODIFIER
INVMODTITLEINVOCTALCHARINVOPERANDINVPPKEYWORD
INVPROTODEFINVPTRMATHINVSTORCLASSINVSUBUSE
INVSUBVALUEINVTAGUSEINVVARIANTINVVOIDUSE
LIBERRORLIBLOOKUPMACDEFINREFMACNONTERMCHAR
MACREQARGSMACSYNTAXMACUNEXPEOFMAXMACNEST
MERGEDMISARGNUMBERMISPARAMNUMBERMISPARAMTYPE
MISPARENSMISSENDIFMISSEXPMISSPELLEDMODNOMACSUB
MODZERONAMETOOLONGNESTEDCOMMENTNOBJECTNOFLOATOP
NOLISTINGNOMIXNMATCHNONOCTALDIGITNONOCTALESC
NONPORTADDRNONPORTARGNONPORTCLASSNONPORTCOMP
NONPORTCONSTNONPORTCVTNONPORTINCLUDENONPORTINIT
NONPORTOPTIONNONPORTPPDIRXNONPORTPTRNONPORTTYPE
NONSEQUITURNONTERMCHARNONTERMNULCHARNONTERMSTRING
NOOPTIMIZATIONNOSUBSTITUTIONNOTFUNCTIONNOTPARAMETER
NOTPOINTERNOTSWITCHNOTUNIQUENULCHARCON
NULHEXCONOVERDRAFTPARAMNOTUSEDPARAMREDECL
PARSTKOVRFLWPPUNEXPEOFPTRFLOATCVTQUALNOTLVALUE
QUALNOTSTRUCTREDEFPROTOREDUNDANTREPABBREV
REPLACEDREPOVERFLOWRESERVEDSCALEFACTORSEMICOLONADDED
SUMMARYSYMTABOVFLSYNTAXERRORTBLOVRFLW
TOOFEWMACARGSTOOMANYCHARTOOMANYERRTOOMANYFUNARGS
TOOMANYINITSTOOMANYMACARGSTOOMANYMACPARMTOOMANYSTR
TRUNCFLOATTRUNCSTRINITTYPECONFLICTTYPEINLIST
UABORTUNDECLAREDUNDEFIFMACUNDEFLABEL
UNDEFMACROUNDEFSTRUCTUNEXPENDUNEXPEOFUNEXPPDIRX
UNKSIZEOFUNRECCHARUNRECPRAGMAUNSUPPTYPE
VARNOTMEMBERVOIDCALLVOIDEXPRVOIDNOTFUNCVOIDRETURN
ANACHRONISM
Message The "****" operator is an obsolete form, and may not
be portable.
Informational You used an old-style assignment operator such as =+
or =*. The message is issued if you specified
/STANDARD=PORTABLE on the CC command line.
User Action For the program to be portable, reverse the order of
the operator parts. For example, =+ should be += and
=* should be *=. The old-style operators are
supported by VAX C, but they may not be supported by
other C compilers.
ARGLISTOOLONG
Message Function reference specifies an argument list whose
length exceeds the VAX architecture limit.
Error The size of your argument list in the function call
exceeded 255 longwords.
User Action Rewrite the function definition and function call
with a list whose member(s) take less space; for
example, by passing floating-point and structure
arguments by reference rather than by value. Recall
that floating-point arguments occupy two longwords,
and that structures passed by value occupy as many
longwords as are necessary to contain the whole
structure.
ARGOVERFLOW
Message Length of the argument list for macro "****" exceeds
buffer capacity; overflowing argument(s) considered
to be null.
Warning The total length of the arguments in a macro
reference exceeded the compiler's capacity to store
the arguments prior to substitution.
User Action Shorten or eliminate one or more arguments.
BADCODE
Message Invalid code generation sequence.
Fatal An internal compiler error occurred.
User Action Gather as much information as you can about the
conditions in effect when the error occurred, and
submit an SPR.
BADPSECT
Message The program section (psect) specified by this
statement has conflicting 'nowrite' attributes with
another definition of the same program section.
Warning You specified two or more references to the same
program section, and the attributes of the references
do not correspond.
For example, this message appears when there exists
two globaldef definitions for the same name, but only
one specifies the storage class readonly.
User Action Make all references to a program section consistent.
BITARRAY
Message The CDD description for "****" specifies that it is
an array of bit-fields; it has been converted to a
scalar bit-field.
Informational The compiler generated a declaration of a bit field
whose size is the same as the total size of the
original CDD item. (VAX C does not support arrays of
bit-fields.)
User Action If the generated declaration is acceptable, you need
not take any action; otherwise, change the CDD
description as appropriate.
BITFIELDSIZE
Message The CDD description for bit-field "****" specifies a
size greater than 32; the excess is declared
separately.
Informational VAX C generated a series of bit-field declarations
whose total size is the same as the original CDD
item. (VAX C does not support individual bit-fields
larger than 32 bits.)
User Action If the generated declarations are acceptable, you
need take no action; otherwise, change the CDD
description as appropriate.
BOUNDADJUSTED
Message The CDD description for "****" specifies
non-zero-origin dimension bound(s); adjusted to
zero-origin.
Informational VAX C generated a declaration whose bound(s) have
been adjusted to start at zero. The generated array
had the same number of elements as the original CDD
item. (VAX C does not support dimension bounds that
do not start at zero.)
User Action Make sure that subscript expressions in references to
this array are offset by the appropriate amounts.
BUGCHECK
Message Compiler bug check during ****. Submit an SPR with a
problem description.
Fatal An internal error occurred during the specified phase
of compilation.
User Action Gather as much information as possible about the
conditions under which the error occurred, including
the phase of compilation, and submit an SPR (refer to
Installing VAX C.)
CASECONSTANT
Message Case label value is not a constant expression.
Error You specified a value in a case label that was not a
constant.
User Action Replace the case value with a valid constant
expression.
CDDATTRIGNORED
Message The CDD description for "****" specifies the "****"
attribute, which is being ignored.
Informational The CDD record description specifies an attribute for
the indicated item that is not supported by VAX C.
The compiler ignores the indicated attribute.
User Action None.
CDDTOODEEP
Message The attributes for the Common Data Dictionary record
description "****" exceed the implementation's limit
for record complexity.
Error The indicated record description was too complex for
VAX C to generate usable declarations.
User Action Simplify the record description in the CDD.
CMPLXINIT
Message "****" is too complex to initialize.
Warning The depth of the indicated aggregate variable
exceeded the limit of 32 levels.
User Action Simplify or correct the initializer list or
declaration, or initialize the variable within an
assignment statement.
COLMAJOR
Message The CDD description for "****" specifies that it is a
column-major array; it has been converted to a
one-dimensional array.
Informational VAX C generated a declaration for this item with a
single dimension. (VAX C supports only row-major
arrays.)
The number of elements in the array is the same as
the total number of elements in the original array.
User Action Make sure that you properly compute references to
this array.
COMPILERR
Message Previous errors prevent continued compilation.
Please correct reported errors and recompile.
Fatal The compiler detected too many errors to continue.
User Action Correct the errors reported in the previous compiler
messages.
CONFLICTDECL
Message This declaration of "****" conflicts with a previous
declaration of the same name.
Warning The compiler determined that both declarations refer
to the same object, yet the two declarations conflict
in data type or organization.
In addition, for external variables and global
symbols, the compiler may detect conflicting storage
class specifiers, or identifiers that are spelled the
same but consist of letters that are in different
cases (the Linker converts all external and global
names to uppercase letters). If the compiler issues
an error message for this reason, the program may be
correct; issuing a message in this instance is a
warning against possible programming errors.
User Action If the declarations refer to the same object, make
sure that they specify the same types and
organizations. Otherwise, either rename one of the
identifiers, or separate the scopes of the
declarations.
CRXCONDITION
Message Common Data Dictionary description extraction
condition.
Informational An anomaly occurred during the extraction of a CDD
record description. The specific condition is
described in an accompanying message. The severity
of this message may be increased to warning or error
depending on the specific condition.
User Action If necessary, correct the indicated condition in the
CDD record description.
DEFTOOLONG
Message Text in #define preprocessor directive is too long;
directive ignored.
Warning The length of the token-string in the #define line
exceeded the implementation's limit.
User Action Simplify the line.
DIVIDEZERO
Message Constant expression includes divide by zero; the
result has been replaced with 0.
Warning A division by zero was encountered in a constant
expression. The expression was replaced by 0.
User Action Made sure that no divisors in the expression can
evaluate to zero.
DUPCASE
Message Duplicate case label value "****".
Error You specified more than one case for the indicated
value in a switch statement. (The cases must be
unique.)
User Action Change the case labels and/or combine the cases, as
appropriate.
DUPDEFAULT
Message Duplicate default label.
Error You specified more than one default case in the same
switch statement.
User Action Combine the cases or make other changes necessary to
eliminate the duplicate(s).
DUPDEFINITION
Message Duplicate definition of "****".
Warning The named definition appeared more than once in the
program.
The two definitions are essentially the same. Both
definitions specify the same data types and
organizations, but there may be differences in the
values, initializers, or array bounds. If the name
is a function, there may be a difference in the
number or types of parameters, or in the contents of
the function body.
User Action The purpose of this message is to call a possible
programming error to your attention.
DUPLABEL
Message Duplicate label "****".
Error You specified duplicates of the indicated label in
the same function. (Label identifiers must be unique
within a function definition.)
User Action Rewrite the labels (and goto statements that refer to
them) to eliminate the duplicates.
DUPMAINFUNC
Message Duplicate main function.
Warning You have defined two or more main functions in the
same compilation unit. A main function is any
function whose name is "main", or whose definition
specifies the "main_program" function definition
option.
User Action Make sure that there is only one such function in the
compilation unit.
DUPMEMBER
Message Duplicate declaration of member "****" .
Warning You declared two members with the same name in the
same structure.
User Action Rename one of the members or remove one of the member
declarations.
DUPPARAMETER
Message Duplicate parameter "****" ignored.
Warning The stated function parameter occurred more than once
in the function's formal parameter list, as in
funct(a,b,c,a) { }
All occurrences of the parameter after the first are
ignored.
User Action Remove or change the duplicate parameter identifier.
ENUMCLASH
Message Mismatched enum type in "****" operation.
Warning The indicated operation combined an enum variable or
value with a value of a nonmatching type. The
compiler issued this message if you used the
/STANDARD=PORTABLE qualifier on the CC command line.
User Action Use a cast operation to cast either the enum value or
the other value to a matching type.
ENUMOP
Message "****" is an undefined operation for enum values;
enum operand(s) converted to int.
Warning You used an enum variable or constant with an
arithmetic or bitwise operator. These operators are
undefined for use with enum types. The operation is
performed; however, the compiler treats the enum
object as an integer.
User Action Cast the enum object to int.
EXTRACOMMA
Message Extraneous comma in macro parameter list ignored.
Warning The #define macro definition on this line had extra
commas that were ignored.
User Action Make sure that no parameters are omitted in the macro
definition.
EXTRAFORMALS
Message Extraneous formal parameter(s) ignored in declaration
of "****"
Warning You included a function's formal parameters in a
function declaration or definition.
For example, the following function declaration is
not allowed because it names the function's
parameters:
int funct(a,b,c);
The parameters a, b, and c are ignored.
Similarly, the following example defines a function
returning a pointer to a function returning an
integer. The names of the parameters of the function
returning an integer are not allowed:
int (*f(p1,p2))(q1,q2)
int p1, p2;
{...}
The compiler ignores the parameters q1 and q2.
User Action Check the syntax of the function declaration and, if
appropriate, remove the extraneous identifier(s).
EXTRAMODULE
Message Redundant #module preprocessor directive ignored.
Warning You specified more than one #module directive in a
single compilation; the excess line or lines were
ignored.
User Action Make sure that there exists only one #module
directive in the source file, and that it is placed
before any VAX C source code.
EXTRATEXT
Message Extraneous text in preprocessor directive ignored.
Informational Extraneous text appeared in the directive, as in
#endif ABC
The compiler issued this message if you specified the
/STANDARD=PORTABLE qualifier on the CC command line.
User Action Either remove the extraneous text or enclose it in a
comment.
FATALSYNTAX
Message Fatal syntax error.
Fatal The compiler could not continue due to syntax errors.
User Action Correct the error in the indicated line and/or errors
reported in previous compiler messages.
FILENOTFOUND
Message Include file could not be opened.
Fatal The compiler could not find the include file in any
of the valid text libraries or directories.
User Action Check to see if the file does exist. Then check that
the include method you used for this file will search
for the file in the place you expect.
FLOATCONFLICT
Message The CDD description for "****" specifies the
D_floating data type; the data cannot be represented
when compiling with /G_FLOAT.
Warning The data type of the indicated CDD item conflicted
with the indicated command line qualifier.
Only one of the two double-precision, floating-point
data formats may be used in a compilation, as
specified by the command line qualifier (the default
qualifier being /NOG_FLOAT). VAX C generates a
declaration of an 8 byte structure for the item.
User Action Specify the appropriate command line qualifier, or
change the description of the item in the CDD.
FLOATOVERFLOW
Message Overflow during evaluation of floating point constant
expression.
Error Overflow occurred during the evaluation of a constant
expression containing floating-point operands.
User Action Make sure that the expression value is in the range
0.29 * 10**-38 to 1.7 * 10**38.
FUNCNOTDEF
Message Static function "****" is not defined in this
compilation; assumed to be external.
Warning The indicated static function declaration did not
refer to an existing definition. The compiler
treated the function as external.
User Action Remove the storage class specifier static in the
function declaration or use the specifier in the
appropriate function definition.
GLOBALENUM
Message Enumerators may not be initialized when declared with
"globalref".
Warning You attempted to specify the values of enumeration
constants in a declaration of an enum variable with
the globalref storage class specifier.
You must define these values elsewhere, in a
globaldef declaration, and you must not initialize
them in the globalref declaration.
User Action Remove all initializing values from the globalref
declaration.
IFEVALERROR
Message **** while evaluating #if or #elif expression; "true"
expression assumed.
Warning The substitute text is "Stack overflow," or "Divide
by zero."
User Action For stack overflow, reduce the complexity of the
expression. Make sure that no divisors are zero.
IFNOMACSUB
Message Macro substitution cannot be performed during the
scan of a macro reference; "****" not substituted;
"true" expression assumed.
Warning You wrote a complex macro reference with an #if
directive and another macro reference, as in
macref(arg1,
#if SUBST
.
.
.
,arg2)
where SUBST has a substitution defined in a previous
#define line. The substitution (here, for SUBST) was
not performed, and the truth value of the directive
was assumed to be true.
User Action Replace the reference to the macro in the #if
expression with its actual value, or restructure the
#if construct so that it is not within the complex
macro reference.
IFSYNTAX
Message Syntax error in #if or #elif expression; true
expression assumed.
Warning The #if or #elif expression on the indicated line
cannot be evaluated because of syntax errors; it was
assumed to be true.
User Action Correct the line.
IGNORED
Message Unexpected **** ignored.
Warning The compiler encountered an unexpected token in the
source program, and has ignored it. (This may be a
syntax error.)
User Action Make sure that the token and surrounding text is
syntactically correct.
INSBEFORE
Message Inserted **** before ****.
Warning The compiler attempted to recover from a syntax error
by inserting a token into the source.
User Action Correct the syntax.
INSMATCH
Message Inserted **** to match **** ****.
Message Inserted **** to match **** inserted earlier.
Warning The compiler attempted to recover from a syntax error
by inserting a token to match a previous token in the
source code. The previous token may or may not have
been inserted by the compiler.
User Action Make sure that you match all parentheses, brackets,
and braces.
INTVALERROR
Message Integer value not used where required.
Error You used a noninteger value as an initializer for an
enum constant, or to specify the size of a bit field.
You must specify these values as integer constants.
User Action Specify an integer constant.
INTVALREQ
Message Non-integer value used incorrectly in a ****;
converted to integer.
Warning You used a noninteger value in a switch statement or
a case label. The value has been converted to
integer.
User Action Specify switch expressions and case label values as
integer values, or use a cast operator to make the
conversion explicit.
INVAGGASSIGN
Message Invalid aggregate assignment.
Error You attempted to assign an array to another array or
to assign structures or unions of different sizes.
User Action Correct the assignment.
INVALIDIF
Message "****" is not a valid constant or operator in a #if
or #elif expression; "true" expression assumed.
Warning You used an invalid construction in an #if or #elif
expression, which is assumed to be true.
User Action Correct the expression.
INVALIGNSPEC
Message Invalid alignment specification ignored.
Warning You specified an alignment option that was not in the
allowable range. The compiler ignored the specified
option.
User Action Correct the alignment specification.
INVALINIT
Message The initialization of "****" is not valid.
Warning The indicated object cannot be initialized as
specified. Some objects may not be initialized at
all, such as functions, unions, and extern or
globalref objects. In other cases, the initializer
may not be appropriate, for example, a static pointer
cannot be initialized with the address of an
automatic variable. This and any subsequent
initializers for the same object have been ignored.
User Action Eliminate or correct the initializer, or correct the
type or storage class of the target object, or
initialize the object with an explicit assignment.
INVANAFILE
Message The compiler has generated an invalid ANA file.
Please submit an SPR with the sources which generate
this error.
Warning The compiler generated an inconsistent .ANA file for
this source file.
User Action First, correct all other errors. If the message is
still generated, submit an SPR (refer to INSTALLING
VAX C), making sure to include the source program and
any necessary include files. Do not attempt to load
the .ANA file into your SCA library.
INVANAFILE
Message The compiler has generated an invalid ANA file.
Please submit an SPR with the sources which generate
this error.
Warning The compiler has generated some invalid data in the
ANALYSIS_DATA file.
User Action Correct all other errors. If the error persists
please submit an SPR.
INVARRAYBOUND
Message The declaration of "****" specifies a missing or
invalid array bound.
Error In a declaration of an array, you omitted a required
dimension bound value or specified an invalid value
for a bound.
For multidimensional arrays, you must specify bounds
for dimensions other than the first. You also must
specify a bound for the first (or only) dimension if
this declaration is a definition. Valid bound values
are integer constant expressions greater than zero.
User Action Make sure that all required bounds are present and
valid.
INVARRAYDECL
Message "****" is an improperly declared array.
Error You improperly declared an array, such as an array of
functions.
User Action Make sure that the syntax of the declarator correctly
describes the object. (The declared object may not
be what you want.)
You may find the output from the /SHOW=SYMBOLS
qualifier to be helpful in diagnosing this error.
INVASSIGNTARG
Message Invalid target for assignment.
Error You specified, as the left operand of an assignment
operator, an expression that was not valid for
assignment. For example, you may have tried to
assign something to an array, to a function, to a
constant, or to a variable declared with either the
storage class modifier readonly or the data type
modifier const.
User Action Make sure that the target is appropriate for
assignments.
INVBREAK
Message Invalid use of the "break" statement.
Error You used break outside the body of a for, a while, a
do, or a switch statement.
User Action Remove the break statement, or check that any braces
in recent loops or switch statements are properly
balanced.
INVCMDVAL
Message "****" is an invalid command qualifier value.
Fatal The indicated CC command qualifier value was
acceptable to the VAX/VMS command language
interpreter (CLI), but it is meaningless to VAX C;
for example, LIST_OPTS is an invalid value for /SHOW,
although it is accepted by the CLI.
User Action Correct the qualifier value.
INVCONDEXPR
Message The second and third operands of a conditional
expression cannot be converted to a common type.
Error You specified an invalid combination of operands in a
conditional expression.
This can occur if the operands are pointers to
objects of a different size or type, or if the
operands are different structures.
User Action Make sure that both operands are of compatible sizes
and data types.
INVCONST
Message "****" is an invalid numeric constant.
Warning The indicated constant contained illegal characters
or was otherwise invalid.
User Action Correct the constant.
INVCONTINUE
Message Invalid use of the "continue" statement.
Error You used the continue statement outside the body of a
for, while, or do statement.
User Action Remove the continue statement, or check that any
braces in recent loops are properly balanced.
INVCONVERT
Message The source or target of a conversion is
noncomputational.
Error One of the operands in an expression could not be
converted as specified. For example, you attempted
to cast some object to a structure.
User Action Correct the expression or cast.
INVDEFNAME
Message Missing or invalid name in **** preprocessor
directive.; directive ignored.
Warning The indicated directive was missing a required name,
as in:
#define
The entire directive was ignored.
User Action Correct or remove the directive.
INVDICTPATH
Message Missing or invalid path name in #dictionary
preprocessor directive; directive ignored.
Warning The indicated directive was missing a required name,
as in:
#dictionary
The compiler ignores the entire directive.
User Action Correct or remove the directive.
INVFIELDSIZE
Message The declaration of "****" specifies an invalid field
size; size of 32 bits assumed.
Warning The indicated field declaration was invalid because
it specified too large a size.
User Action Correct the declaration to specify either a single,
smaller field or several contiguous fields.
INVFIELDTYPE
Message The declaration of "****" specifies an invalid data
type; type "unsigned" assumed.
Warning You declared a field with an invalid data type.
Fields must be declared (and manipulated) as integers
or enumerated types.
User Action Correct the declaration to specify a valid data type.
INVFILESPEC
Message Missing or invalid file specification in #include
preprocessor directive; directive ignored.
Warning The #include directive either was missing a file or
module name or specified one that is syntactically
invalid. The directive was ignored.
User Action Correct the line.
INVFUNCDECL
Message "****" is an improperly declared function.
Error You improperly declared a function. For example, you
may have omitted the parameter list or a semicolon
between the function and a previous declaration.
User Action Correct the syntax of the declaration.
INVFUNCOPTION
Message Invalid function definition option "****" ignored.
Warning The indicated function definition option was not
supported. (The only valid option is the option,
main_program.)
User Action Check the spelling of the option, or the syntax of
the function definition.
INVHEXCHAR
Message Invalid hexadecimal character value; high-order bits
truncated.
Warning An escape character specifed in hexadecimal exceeded
the limit of a one byte character.
User Action Correct the hexadecimal constant to represent a valid
escape character.
INVHEXCON
Message Hexadecimal constant contains an invalid character.
Error You specified an invalid hexadecimal constant, such
as 0xG.
User Action Correct the constant.
INVIFNAME
Message Missing or invalid name in #ifdef or #ifndef
preprocessor directive; "true" assumed.
Warning You specified no name, or a syntactically invalid
one, in the directive; the result of the test is
assumed to be true.
User Action correct the directive.
INVLINEFILE
Message Invalid file specification in #line preprocessor
directive; directive ignored.
Warning The file specification was syntactically invalid, and
the directive was ignored.
User Action Correct the line.
INVLINELINE
Message Missing or invalid line number in #line preprocessor
directive; directive ignored.
Warning The line number was missing or was syntactically
invalid, and the directive is ignored.
User Action Correct the line.
INVMAINRETVAL
Message Return value of main function is not an integer type.
Warning You have declared a main function with a return value
that is not an integer type.
User Action Check for an omitted semicolon at the end of any
declaration immediately preceding the declaration of
the main function or change the return value
specification to one of the integer types.
INVMODIDENT
Message Invalid ident specification in #module preprocessor
directive; directive ignored.
Warning The ident specification in the directive either was
not a valid identifier or was not a valid
character-string constant.
User Action Correct the line.
INVMODIFIER
Message "****" is an invalid data type modifier in this
declaration.
Warning You specified a data type modifier other than const
or volatile as in the the following example:
char *int ptr;
The data type modifier int will be ignored.
User Action Remove or change the data type modifier.
INVMODTITLE
Message Missing or invalid title specification in #module
preprocessor directive; directive ignored.
Warning The required title in the directive either was
missing or was not a valid identifier.
User Action Correct the directive.
INVOCTALCHAR
Message Invalid octal character value; high-order bits
truncated.
Warning The octal value in an escape sequence was too large,
as in '\477'. Its high-order bits were truncated.
User Action Correct the value.
INVOPERAND
Message Invalid **** operand of a "****" operator.
Error You specified an invalid operand for the indicated
operator.
This message is issued for arithmetic and bitwise
operators if the operand is noncomputational (such as
a structure). For other operators (such as the
increment operator), the compiler issues the message
if the operand is not an lvalue. For binary
operators, the substituted text indicates which
operand, left or right, is invalid.
User Action Make sure that the operand is the proper type for the
operator, and that it is an lvalue.
INVPPKEYWORD
Message Missing or invalid keyword in preprocessor directive;
directive ignored.
Warning You wrote a directive with no keyword, as in:
# ABC
The directive is ignored.
User Action Correct or remove the directive.
INVPROTODEF
Message The parameter list for a function prototype
definition must associate an identifier with each
type.
ERROR The parameter list in a function definition does not
have one type with per identifier for each
parameter.
User Action Identify which parameter is incomplete and add either
the type name or identifier.
INVPTRMATH
Message Invalid pointer arithmetic.
Error You attempted to perform an invalid arithmetic
operation on a pointer or pointers. The only valid
arithmetic operations allowed with pointers are
addition and subtraction.
Furthermore, for addition, the only allowable forms
are as follows:
pointer + integer
pointer += integer
For subtraction, the only allowable forms are as
follows:
pointer - integer
pointer -= integer
pointer - pointer
In the last form, both pointers must point to objects
of the same size.
User Action Make sure that the expression conforms to one of the
forms listed above. If necessary, cast one or both
operands to a compatible type.
INVSTORCLASS
Message "****" is an invalid storage class in this
declaration.
Message The "****" storage class is invalid for the
declaration of "****".
Warning You made one of the three following programming
errors:
1. You specified a storage class that is invalid in
the context in which the declaration appears; for
example, specifying auto in a declaration located
outside of a function.
2. You specified a storage class that is
incompatible with another storage class
specifier; for example, specifying both static
and extern.
3. You specified a storage class that is
incompatible with the data type of the indicated
declarator; for example, specifying globalvalue
for an array.
In all cases, the compiler ignores the storage class
specifier.
User Action Correct the declaration.
INVSUBUSE
Message Invalid use of subscripting.
Error You specified a subscript in reference to a
bit-field.
User Action Correct the syntax. If the structure containing the
bit-field is an array, you must specify the
subscript(s) with the qualifier rather than with the
member name.
INVSUBVALUE
Message Invalid subscript value.
Error You specified a subscript value which is not of an
integer type.
User Action Change or cast the value to an integer type.
INVTAGUSE
Message Invalid use of tag "****".
Error You used a previously declared tag name with a
different data type.
User Action Make sure that the use of tag names is unique to each
of the data types, enum, struct, or union.
INVVARIANT
Message Invalid declaration of variant aggregate "****".
Error You attempted an invalid variant structure or union
declaration such as an array of variants, a pointer
to a variant, or a list of variant names.
User Action Remove either the variant keyword from the
declaration or make sure that the keyword is used in
a valid structure or union declaration.
INVVOIDUSE
Message "void" is only valid in a parameter list when it
appears alone. Its use is ignored.
Warning "void" has been used in a function prototype
parameter list but is not the only item in the list.
User Action Either eliminate "void" or eliminate the extra
parameter types in the parameter list.
LIBERROR
Message Error while reading library "****".
Fatal The compiler could not read the indicated library.
Either it was not a text library, or its format had
been corrupted.
User Action Verify the spelling of the library's name, and verify
that it is a valid VAX/VMS text library.
LIBLOOKUP
Message "****" was not found in any of the specified
libraries.
Fatal The compiler failed to locate the indicated #include
module in any of the specified or default libraries.
User Action Check the CC command line to verify that the library
containing the module was specified and that the
module name, if specified, was spelled correctly. If
the library was a default library, verify (with SHOW
TRANSLATION C$LIBRARY) that its name is the
equivalent for C$LIBRARY.
MACDEFINREF
Message A macro cannot be **** during the scan of a reference
to the macro; line ignored.
Warning You tried to redefine or undefine a macro within a
reference to it. The compiler ignores the
preprocessor directive.
User Action Move the directive to a position outside of the macro
reference.
MACNONTERMCHAR
Message Nonterminated character constant in macro argument;
apostrophe added at end of line.
Warning You omitted the closing apostrophe in a character
constant appearing in an argument in a macro
reference.
User Action Correct the constant.
MACREQARGS
Message Macro reference requires an argument list; "****" not
substituted.
Error You wrote a macro reference without an argument list.
The reference was deleted from the source file.
User Action Correct the reference, specifying the same number of
arguments as in the definition of the macro.
MACSYNTAX
Message Syntax error in macro definition; line ignored.
Warning The syntax of the parameter list in a macro
definition was invalid. (You must enclose the
parameter list in parentheses and delimit individual
parameters with commas.)
User Action Correct the syntax.
MACUNEXPEOF
Message Unexpected end-of-file encountered in a macro
reference; "****" not substituted.
Error The end-of-file was encountered during a macro
reference; the reference was deleted.
User Action See if you misplaced the closing parenthesis in the
macro argument list.
MAXMACNEST
Message Maximum text replacement nesting level exceeded;
"****" not substituted.
Error You specified a macro reference which is recursive or
otherwise causes repeated substitutions to a depth
greater than the implementation maximum of 64.
User Action Correct the recursion or simplify the definitions.
MERGED
Message Merged **** and **** to form ****.
Warning The compiler merged two separate source tokens into a
single token.
For example, two plus signs separated by a space may
be merged to form the increment operator ++.
User Action If the compiler's action is correct, remove the space
between the tokens. Otherwise, check for a missing
token between those merged.
MISARGNUMBER
Message The number of arguments passed to the function does
not match the number declared in a previous function
prototype.
Warning You specified too many or too few arguments during
the call to the function. In file scope is a
function prototype that specifies a different number
of arguments.
User Action Determine from the prototype what arguments are
missing for the call.
MISPARAMNUMBER
Message The number of parameters declared does not match the
number declared in a previous function prototype.
Warning You specified too many or too few parameters in this
parameter list. In file scope is a function
prototype that specifies a different number of
parameters.
User Action Determine from the prototype what arguments are
missing for the call.
MISPARAMTYPE
Message The type of parameter "!AD" does not match the type
declared in a previous function prototype.
Warning One of the types in the parameter list is different
from the corresponding parameter type declared in the
prototype.
User action Determine from the type declared in the previous
prototype what the type should be in this parameter
list.
MISPARENS
Message Mismatched parentheses in a #if or #elif expression;
"true" expression assumed.
Warning The expression in a #if or #elif preprocessor
directive contained unbalanced parentheses.
User Action Make sure that you balanced the parentheses in the
expression.
MISSENDIF
Message Missing #endif preprocessor directive(s).
Error The compiler did not encounter an #endif line for the
most recent #if, #ifdef, or #ifndef.
User Action Be sure that the directives are properly structured,
and, if appropriate, add the missing #endif
preprocessor directive(s).
MISSEXP
Message Missing or invalid exponent in float constant; zero
exponent ('e0') assumed.
Warning You wrote a floating-point constant with the letter
'e' or 'E' but with no exponent or an invalid
exponent. The exponent was assumed to be zero.
User Action Correct the constant.
MISSPELLED
Message Replaced **** with ****. Warning You misspelled a reserved word. User Action Correct the spelling.
MODNOMACSUB
Message Macro substitution cannot be performed during the
scan of a macro reference; "****" not substituted;
line ignored.
Warning You wrote a complex macro reference that includes a
#module line containing a macro reference, as in:
macref(arg1,
#module SUBST
.
.
.
,arg2)
where SUBST has a substitution defined in a previous
#define line. The substitution (here, for SUBST) was
not performed, and the #module line was ignored.
User Action Replace the macro reference in the #module line with
its actual value, or move the #module line to a
position outside the complex macro reference.
MODZERO
Message Constant expression includes mod 0; the result has
been replaced with 0.
Warning The constant expression had an invalid mod
expression, such as 5 % 0. The result was zero.
User Action Correct the expression (but note that its operands
must not be floating-point).
NAMETOOLONG
Message Identifier name exceeds 31 characters; truncated to
"****".
Warning VAX C identifiers are limited to a length of 31
recognized characters.
User Action Shorten the indicated identifier.
NESTEDCOMMENT
Message Nested comment encountered.
Informational The compiler detected an opening comment delimiter /*
within another comment. (VAX C does not support the
nesting of comments; the first ending comment
delimiter */ encountered ends the comment.)
User Action Check that you have not misplaced a comment delimiter
and inadvertently "commented out" necessary code.
NOBJECT
Message No object file produced.
Informational The compiler did not produce an object file, due to
conditions reported in previous messages.
User Action Make the corrections suggested by the other
message(s).
NOFLOATOP
Message The **** operand of a "****" operator has been
converted from floating-point to integer.
Warning The compiler converted the operand to an integer.
The left or right operand of the indicated binary
operator, or the operand of the indicated unary
operator, cannot be of type float or double.
User Action Change or cast the operand to an integral type.
NOLISTING
Message No listing file produced.
Informational The compiler did not create a listing file (usually
due to previously reported errors).
User Action None.
NOMIXNMATCH
Message The parameter list of a function can either contain
all identifiers or all types, but not both.
Error There was a mix in this parameter list between the
identifier-list format and the
parameter-prototype-list format.
User action Change the format to be consistent with the syntax
rules for parameter lists.
NONOCTALDIGIT
Message Octal escape sequence in a character or string
constant terminated by a non-octal digit.
Warning There was an 8 or 9 in the second or third position
of an octal escape sequence. In this case, the
digits preceding the non-octal digit were evaluated,
and the 8 or 9 was considered a separate character.
The compiler issued this message if you used the
/STANDARD=PORTABLE qualifier on the CC command line.
User Action Make sure that the escape sequence contains only
octal digits. If the 8 or 9 is separate from the
escape sequence, yet must immediately follow it, then
pad the escape sequence to three digits using leading
zeros.
NONOCTALESC
Message Escape sequence in a character or string constant
starts with a non-octal digit.
Warning The first of three digits of an escape sequence was
an 8 or 9. In this case, the backslash is ignored,
and the 8 or 9 was treated as a character. The
compiler issued this message if you used the
/STANDARD=PORTABLE qualifier on the CC command line.
User Action Make sure that the compiler resolved the ambiguity
correctly.
NONPORTADDR
Message Taking the address of a constant may not be portable.
Informational You used an ampersand operator with a constant in the
argument list of a function call. (VAX C permits
this special case, but other compilers may not.)
User Action If you do not require portability, no action is
necessary. Otherwise, correct the line.
NONPORTARG
Message Passing a structure by value may not be portable.
Informational You passed a structure by value in a function call or
declared a function parameter as a structure. This
message is issued if you used the /STANDARD=PORTABLE
option on the CC command line.
User Action If the program must be portable, pass the structure
by reference.
NONPORTCLASS
Message Storage class "****" is not portable.
Informational This message was issued against the use of the
globalref, globaldef, globalvalue, readonly, or
noshare storage class specifiers. This message is
issued if you specified the /STANDARD=PORTABLE
qualifier on the CC command line.
User Action No action is necessary if you do not require
compatibility with other C compilers. Otherwise,
correct the line.
NONPORTCOMP
Message Comparison of a pointer with a nonzero integer
constant or an integer expression may not be
portable.
Informational You compared a pointer to something besides another
pointer or the constant 0. This message is issued if
you specified /STANDARD=PORTABLE on the CC command
line.
User Action Change the operands or casting them to the same type.
This usage is not portable and is not recommended.
The only portable comparison is a comparison between
a pointer variable and 0.
NONPORTCONST
Message Character constant **** may not be portable.
Informational VAX C allows up to four characters to be specified in
a character constant, but other compilers may not.
The compiler issues this message if you use the
/STANDARD=PORTABLE qualifier on the CC command line.
User Action If you do not require portability, no action is
necessary.
NONPORTCVT
Message Conversions between pointers and integers may not be
portable.
Informational You assigned an integer to a pointer or an address to
an integer variable. This message is issued if you
specified /STANDARD=PORTABLE on the CC command line.
User Action Change the operands or cast them to the same type.
This usage is not portable and is not recommended.
The only portable assignment is the following:
pointer = 0
NONPORTINCLUDE
Message #include of a library module is not portable.
Informational The specification of a library module name in an
#include preprocessor directive is VAX C specific and
is not portable. This message is issued if you
specified the /STANDARD=PORTABLE qualifier on the CC
command line.
User Action No action is necessary if you do not require
compatibility with other C compilers.
NONPORTINIT
Message Automatic initialization for "****" may not be
portable.
Informational You initialized an array or structure of storage
class auto. This message is issued if you specified
/STANDARD=PORTABLE on the CC command line.
User Action If you require portability, use separate assignment
statement(s) to set the initial value(s).
NONPORTOPTION
Message The "****" function definition option is not
portable.
Informational The VAX C function definition options are VAX C
specific and are not portable. The compiler issued
this message if you used /STANDARD=PORTABLE on the CC
command line.
User Action No action is necessary if you do not require
compatibility with other C compilers.
NONPORTPPDIRX
Message The **** preprocessor directive is not portable.
Informational You used the #dictionary or #module preprocessor
directive.
These lines are VAX C specific and may not be
recognized by other compilers. The compiler issues
this message if you specified /STANDARD=PORTABLE on
the CC command line.
User Action No action is necessary if you do not require program
portability.
NONPORTPTR
Message The use of an integer value as a pointer qualifier
for "****" may not be portable.
Informational In a reference to a structure or union member
accessed via the "->" operator, the qualifying
expression to the left of the "->" should have a
pointer value. VAX C allows the use of integer
values as well, but such usage is not portable. This
message is issued if you specify /STANDARD=PORTABLE
on the CC command line.
User Action Either use a true pointer expression as the
qualifier, or cast the integer expression as an
appropriate structure or union pointer.
NONPORTTYPE
Message Data type "****" is not portable.
Informational You used the data type variant_struct or
variant_union in a declaration or cast.
These data types are specific to VAX C. The compiler
issues this message if you specify /STANDARD=PORTABLE
on the CC command line.
User Action No action is necessary if you do not require program
portablility.
NONSEQUITUR
Message "****" is not a member of the specified structure or
union.
Informational In a reference to the indicated member name, you
specified a qualifier that does not represent the
structure or union to which the member belonged.
The reference is valid, because the member name is
unique and the offset can be resolved unambiguously.
This use of member names is maintained only for
compatibility with older programs.
User Action If the qualifier is a pointer, cast it as a pointer
to the appropriate structure or union.
NONTERMCHAR
Message Nonterminated character constant; **** assumed.
Warning The compiler encountered the end of the source line
before the end of a character constant. The compiler
assumed the indicated value.
User Action Correct the constant.
NONTERMNULCHAR
Message Nonterminated character constant contains no
characters; '\0' assumed.
Warning The compiler detected a single apostrophe ' at the
end of the source line.
User Action Check to see if the apostrophe is extraneous;
otherwise correct the constant.
NONTERMSTRING
Message Nonterminated string constant; quotes added at end of
line.
Warning The compiler encountered the end of the source line
before the end of a character string. The compiler
inserted a quotation mark " at the end of the line.
User Action Check to see if the string should be continued on the
following line; if so, insert a backslash \ at the
end of the line. Otherwise, check for the missing
quotation mark.
NOOPTIMIZATION
Message Complex control flow caused optimization to be
suppressed for procedure or function "****".
Informational Optimization was not performed for the indicated
function.
User Action To take advantage of optimization, simplify the
control flow within the indicated function.
NOSUBSTITUTION
Message Macro substitution cannot be performed during the
scan of a macro reference; "****" not substituted;
directive ignored.
Message Macro substitution cannot be performed during
the scan of a macro reference; "****" not
substituted; "true" expression assumed.
Warning You wrote a complex macro reference that contained a
preprocessor directive which in turn contained
another macro reference. For example:
macref1 ( arg1,
#include MACREF2
.
.
,argn)
The substitution of MACREF2 was not performed and the
directive containing it was ignored. If the
directive was either #if or #elif, the expression
would be assumed to be <quote>true<quote>.
User Action Restructure your code so that the directive is not
contained within the macro reference.
NOTFUNCTION
Message Function-valued expression not found.
Error You used an expression in the context of a function
call, but the expression does not evaluate to a
function.
User Action Make sure that the expression properly evaluates to a
function; also make sure that you properly
dereference any pointer to a function.
NOTPARAMETER
Message "****" is not listed in the function's formal
parameter list; treated as if declared internally.
Warning You declared the specified identifier as a function
parameter, but the identifier does not appear in the
parameter list. For example:
f(a) int a,b; {...}
The identifier b does not appear in the function f's
formal parameter list. Its declaration is not
portable, and is probably a coding error. The
compiler treats b as if it were declared inside the
function definition; in this case, b becomes an
automatic variable.
User Action Correct the declaration or the parameter list.
NOTPOINTER
Message Address-valued expression not found.
Error You used an expression in a context requiring a
pointer value but the expression did not evaluate to
an address.
User Action Make sure that the expression evaluates to a pointer
value.
NOTSWITCH
Message Default labels and case labels are valid only in
"switch" statements.
Error You used case or default as a label outside the body
of a switch statement.
User Action Check for unmatched braces that may have prematurely
terminated the most recent switch statement.
NOTUNIQUE
Message "****" is not a unique member name in this context.
Error You used the same member name in more than one
structure or union definition, and then used that
member name as an offset from some other structure or
union. Since the compiler had no way of knowing
which member definition to use as an offset, a
message was generated.
User Action To avoid ambiguities, try to make all member names
unique.
NULCHARCON
Message Character constant contains no characters; '\0'
assumed.
Warning You used '' for an ASCII NUL character instead of
'\0'.
User Action Use '\0'.
NULHEXCON
Message Hexadecimal constant contains no digits; 0X0 assumed.
Warning You specified a constant such as 0X or 0x.
User Action Be sure that 0 is a valid value in this context; if
so, change the constant to 0x0.
OVERDRAFT
Message **** has gone into DISK QUOTA overdraft.
Informational Your disk I/O quota was exceeded while writing to a
file. (If necessary, your program can continue to
output information.)
User Action Purge your directories to create more space or
increase your disk I/O quota.
PARAMNOTUSED
Message Macro parameter "****" is not referenced in the
definition.
Warning A macro definition had more parameters than appearred
in its substitution, as in:
#define m(a,b,c) a*b
User Action Specify the extra parameter in the substitution or,
if it is actually superfluous, delete it from the
parameter list. (This is a possible programming
error.)
PARAMREDECL
Message This declaration of "****" overrides a formal
parameter.
Warning Your source program contained a redeclaration of one
of the function's formal parameters, as in:
f(a) { int a; }
You cannot reference the parameter from within the
function.
User Action If the declaration is simply misplaced, move it to a
position between the function header and the left
brace at the beginning of the function body.
Otherwise, rename one of the identifiers.
PARSTKOVRFLW
Message Parse stack overflow.
Fatal The source code in you program was too complex,
containing statements nested too deeply.
User Action Simplify the program.
PPUNEXPEOF
Message Unexpected end-of-file encountered in preprocessor
directive; directive ignored.
Warning The compiler detected the end of the source file
while attempting to read a continuation of the last
line.
User Action Check for nonterminated comments, character strings,
and other constructs that can span several lines of
code.
PTRFLOATCVT
Message Operand of pointer addition or subtraction converted
from floating-point to integer.
Warning You combined a pointer operand with a floating-point
value, as in:
int i,*ip;
.
.
.
i = ip + 2.;
User Action Make sure that pointers are used only with other
pointers or with integers; in the above example and
in similar situations, remove the decimal point from
the literal constant.
QUALNOTLVALUE
Message The qualifier for "****" is not a valid lvalue.
Error In a reference to a structure or union member
accessed via the period operator (.), the qualifying
expression to the left of the period must be an
lvalue.
User Action Correct the qualifying expression.
QUALNOTSTRUCT
Message The qualifier for "****" is not a structure or union.
Informational In a reference to a structure or union member, the
qualifying expression to the left of the period
operator (.) or right arrow operator (->) did not
represent a structure or union. The compiler issued
this message if you specified /STANDARD=PORTABLE on
the CC command line.
User Action Check for possible spelling errors.
REDEFPROTO
Message This prototype conflicts with either the function
definition or with a function prototype which appears
earlier in the file.
Warning The function definition or the prototype did not
agree as to the declaration of the types in the
parameter list or to the number of parameters in the
list.
User action Change one of the parameter lists to agree with the
other.
REDUNDANT
Message The operand of the "&" operator is already an
address. The "&" is ignored.
Informational You specified "&" in front of an array or function
name. The message is issued if you specified
/STANDARD=PORTABLE on the CC command line.
User Action Make sure that you intend to pass the address of the
array or function. If you require portability,
remove the redundant "&".
REPABBREV
Message Replaced abbreviation **** with ****. Warning You abbreviated a reserved word. User Action Complete the spelling of all reserved words.
REPLACED
Message Replaced **** with ****.
Warning The compiler replaced an invalid token with a
different token. (Programs that contain syntax
errors usually generate this message.)
User Action Check for incorrect syntax.
REPOVERFLOW
Message Length of replacement text exceeds maximum buffer
capacity; "****" not substituted.
Error The length of the replacement text for a macro
reference or the length of the text plus the rest of
the line exceeded the implementation's limit.
User Action Shorten the replacement text or use multiple
substitutions to achieve the desired result.
RESERVED
Message "****" is a reserved identifier; directive ignored.
Warning You have specified a reserved identifier name in a
#define or #undef preprocessor directive. Such
reserved names may not be redefined or undefined.
They are as follows:
o __DATE__
o __FILE__
o defined
o __TIME__
o __LINE__
User Action Choose a different spelling for the identifier.
SCALEFACTOR
Message The CDD description for "****" specifies a scale
factor of ****; the scale factor is being ignored.
Informational VAX C does not support scaled arithmetic.
User Action Make sure that you appropriately scale computations
involving this item.
SEMICOLONADDED
Message Semicolon added at the end of the previous source
line.
Warning A missing semicolon was added to the line prior to
the line numbered in this message.
User Action Check the previous line carefully and add the
semicolon in the appropriate place.
SUMMARY
Message Completed with **** errors, **** warnings, and ****
information messages.
Message Completed with **** errors, **** suppressed
warning(s), and **** informational messages.
Informational This message indicates the number of compiler
messages (errors, warnings, and informationals)
issued during the compilation process. You can
suppress informational and warning messages using the
/[NO]WARNINGS CC command line qualifier (refer to
Chapter 1 in the Guide to VAX C.)
User Action Consider the individual messages and recompile if
necessary.
SYMTABOVFL
Message The total number of symbol table pages exceeds the
implementation's limit.
Fatal The program was too complex.
User Action Simplify the program by reducing the number and size
of variables and other names, constants, and so
forth.
SYNTAXERROR
Message **** Found **** when expecting ****.
Error The illustrated syntax error prevented the generation
of an object file.
User Action Correct the errors shown.
TBLOVRFLW
Message Internal table overflow, too many procedures,
external symbols (psects), or the program is too
complex.
Fatal Either the source file contains too many functions or
expressions, or the compiler has overflowed its
virtual address space.
User Action Reduce the size of the source file by dividing it
into smaller, separate files, or change the logic of
the program to reduce the number of complicated
expressions.
TOOFEWMACARGS
Message Argument list for macro "****" contains too few
arguments; missing arguments assumed to be null.
Warning You wrote a reference to the indicated macro with
fewer arguments than were specified in its
definition.
User Action Make sure that the number of arguments in the macro
reference is the same as the number of parameters in
the definition.
TOOMANYCHAR
Message Character constant contains too many characters;
truncated to ****.
Warning The length of a character constant exceeded the
implementation limit (four characters). The constant
was truncated to the indicated value.
User Action Reduce the length of the indicated character constant
to four or fewer characters.
TOOMANYERR
Message The total number of errors exceeds the limit of 100.
Fatal The compiler reported more than 100 error messages in
this compilation. The compilation ended at this
point.
User Action Correct the errors reported in previous compiler
messages and recompile.
TOOMANYFUNARGS
Message Function reference specifies too many arguments;
excess arguments ignored.
Warning You called a function with more than 253 arguments.
The compiler passed only the first 253 arguments; the
compiler ignored the remainder.
User Action Shorten the argument list.
TOOMANYINITS
Message The initializer list for "****" specifies too many
initializers; excess initializers ignored.
Warning You specified too many initializers for the indicated
variable. (If the indicated item is an array or
structure, it may be only partially initialized.)
User Action Make sure that all braces near the initializer
sublists are balanced; if the item being initialized
is or contains an array, make sure that you accounted
for all dimensions.
TOOMANYMACARGS
Message Argument list for macro "****" contains too many
arguments; excess arguments ignored.
Warning You wrote a reference to the indicated macro with
more arguments than were specified in its definition.
User Action Make sure that the number of arguments in the macro
reference is the same as the number of parameters in
the definition.
TOOMANYMACPARM
Message Parameter list for macro "****" contains too many
parameters; excess parameters ignored.
Warning The number of macro parameters in a #define
preprocessor directive exceeded the implementation
limit of 64.
User Action Rewrite the macro definition so that it uses 64 or
fewer parameters.
TOOMANYSTR
Message String constant contains too many characters;
truncated.
Warning You wrote a character-string constant whose length
exceeded the implementation's limit of 65,535
characters.
User Action Shorten the string.
TRUNCFLOAT
Message Double precision floating-point constant cannot be
converted to single precision; 0.0 assumed.
Warning You specified a double-precision constant in an
expression involving a conversion to
single-precision, but the constant's value was too
small to be represented in single-precision.
User Action Ensure that 0 is a valid value in this context; if
necessary, redeclare the conversion target as double.
TRUNCSTRINIT
Message String initializer for "****" contains too many
characters to fit; truncated.
Warning If the variable was a simple one-dimensional array,
the initializer was truncated (such that the length
of the initializer was array-1) and the null byte was
added to the end of the array. If the array is a
multidimensional array or an array within a
structure, the initializer was truncated to the
length of the array and a null byte was not added.
User Action Treat arrays of characters as strings allowing for
the null byte at the end of the array. The special
case of multidimensional arrays and arrays within
structures should be taken into account, especially
when you do not want the null byte to be truncated.
TYPECONFLICT
Message "****" conflicts with a previous data type in this
declaration; previous data type ignored.
Warning You specified more than one data type specifier in
this declaration, and the indicated specifier
conflicted with a previous one.
User Action Check for a missing semicolon in the previous
declaration; otherwise, make sure that all specifiers
are compatible.
TYPEINLIST
Message The type of "****" was specified in the parameter
list. This declaration is ignored.
Warning The function definition uses the prototype format but
still contains a declaration of this parameter in the
parameter declaration section.
User action Eliminate the redundant declaration.
UABORT
Message Compilation terminated by user.
Fatal The compilation was terminated by a DCL CTRL/C
command.
User Action None.
UNDECLARED
Message "****" is not declared within the scope of this
usage.
Error You referred to an undeclared variable. (You must
declare variables before you use them.)
User Action Check the spelling of the identifier, or add a
declaration for it, if appropriate.
UNDEFIFMAC
Message "****" is not a currently defined macro; constant
zero assumed.
Warning The identifier in a constant expression in a #if or
#elif preprocessor directive was not currently
defined as a macro. The expression was evaluated as
if the identifier were a constant 0.
User Action Define the identifier as a macro or remove the
reference to it.
UNDEFLABEL
Message Label "****" is undefined in this function.
Error You wrote "goto label-name" for an undefined label.
The scope of a label name is restricted to the
function in which it is used as a label; goto
statements cannot branch to labels inside other
functions.
User Action Check the spelling of the label name or make other
corrections as appropriate.
UNDEFMACRO
Message "****" is already undefined; line ignored.
Warning The specified identifier (in an #undef line) was
either never defined or else occurred in a previous
#undef.
User Action Remove the #undef, or, if applicable, appropriately
add the definition of the identifier.
UNDEFSTRUCT
Message "****" is a structure or union type that is not fully
defined at this point in the compilation.
Error You used a name in the context of a structure or
union tag, but the name is either undefined or is not
yet fully defined as a tag.
User Action Check the spelling of the name, and make sure that it
is fully defined as a tag before it is used.
UNEXPEND
Message Unexpected end-of-**** encountered in #define
preprocessor directive; directive ignored.
Warning The end of the #define directive or end of the source
file was encountered before the definition was
complete.
User Action Check for an incomplete comment within the
definition, or for a missing continuation of the
line.
UNEXPEOF
Message Unexpected end-of-file encountered in a ****.
Error The compiler encountered the end of the source file
while scanning for the end of a string constant or a
comment.
User Action Make sure that string constants and comments are
properly terminated.
UNEXPPDIRX
Message Unexpected **** preprocessor directive encountered;
directive ignored.
Warning The specified directive occurred out of place and was
ignored.
User Action Check the logic of all directives in the program to
be sure that it is valid.
UNKSIZEOF
Message Operand of sizeof has an unknown size; 0 assumed.
Warning The operand of a sizeof operator was an array whose
size was unknown at compile time. A size of zero was
assumed.
User Action Change the declaration of the array to specify the
appropriate dimension bound.
UNRECCHAR
Message Unrecognized character ignored.
Warning The line contained either an entirely meaningless
character or one that appears out of its proper
context, for example, a number sign (#) that was not
the first character on a line.
User Action Move or remove the character.
UNRECPRAGMA
Message Unrecognized pragma; directive ignored.
Informational You have specified a #pragma preprocessor directive
that is not recognized by VAX C.
User Action Correct the syntactic or semantic error that rendered
it unrecognizable. Common errors include misspelled
parameters and ambiguous abbreviations.
UNSUPPTYPE
Message The CDD description for "****" specifies a data type
not supported in C.
Informational The compiler could not represent the indicated item
in a VAX C construct. The compiler generated a
declaration of a structure whose length was the same
as the length of the unsupported data type.
User Action Change the CDD description to specify a supported
data type, if you require a precise representation in
VAX C.
VARNOTMEMBER
Message A variant aggregate must be a member of a struct or
union.
Error You attempted to specify a variant_struct or a
variant_union outside of an aggregate declaration.
User Action If you intend to use the structure or union as
declared, and if the structure or union is the
outermost aggregate in a group of nested aggregates,
replace the variant keywords with struct or union.
If you intend on using the structure or union as a
variant aggregate, and if the structure or union is
otherwise properly declared, nest the declaration
within a valid structure or union declaration. If
you used the variant_struct or variant_union keywords
in declarations other than structure or union
declarations, remove the variant keywords.
VOIDCALL
Message A "void" function cannot be invoked in a context
where a value is expected.
Error You coded a call to a function declared as void, but
the call appeared in a context where a return value
was expected.
User Action Move the function call to a different context, or if
the function does return a value, declare it to be
int or another appropriate type.
VOIDEXPR
Message A "void" expression cannot be used in a context where
a value is expected.
Error You cast an expression to be void, but the expression
was used in a context where its value was required.
User Action Remove the cast, or move the expression to a context
that requires no value.
VOIDNOTFUNC
Message "****" is not declared to be a function; only
functions may be declared "void".
Error You declared an object other than a function to be
void.
User Action Check the syntax of the declarator. You may find the
output produced by the /SHOW=SYMBOLS CC command line
qualifier to be helpful in diagnosing this problem.
VOIDRETURN
Message A "return" statement in a "void" function may not
specify a value; expression ignored.
Warning You specified a value in a return statement within a
function declared as void.
User Action Either remove the return value or redefine the
function as returning the appropriate data type.
Language topics
VAX C language topics
Additional information available:
BlockValid File SpecificationsData TypesDeclarationsFunctionsPreprocessor
Predefined tokensStatementsStorage ClassesData type modifiers
Storage class modifiers
Block
A block is a compound statement. It allows more than one statement
to appear where a single statement ordinarily is used. It is made
up of a list of declarations and statements, enclosed in braces:
{ [declaration ...] [statement ...] }
The declaration list is optional; if it is included, all
declarations of variables are local to the block and supersede
previous declarations for the duration of the block. Any auto or
register variables are initialized each time the block is entered
normally; the initializations do not occur if the block is entered
by a goto statement. Blocks can be used wherever single statements
are valid--for example, as the action clause of an if statement:
if ( i < 1 )
{ /* BEGINNING OF BLOCK */
char x;
for (x = 'a'; x <= 'z'; x++)
printf("char = %c\n", x);
} /* END OF BLOCK */
Valid File Specifications
Since the VAX C Run-time Library (RTL) includes functions from the
DEC/Shell RTL, all valid VAX/VMS file specifications and most UNIX*
system file specifications are acceptable. Combinations of the two
specifications are not supported by VAX C.
An example of a valid UNIX file specification is as follows:
beatle!/dba0/lennon/songs.lis.3
An example of an invalid file specification is as follows:
BEATLE::DBA0:[LENNON.C]/songs.lis.3
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
Data Types
The data type of an object must be specified in its declaration. The fundamental data types are the scalar types: int 32-bit signed integer unsigned 32-bit unsigned integer float single-precision floating-point number double double-precision floating-point number enum enumerated type char character The adjectives short and long can also be used to specify the size of the object. For example, a short int is a 16-bit signed integer. A long int is the same as an int in VAX C. A long float is the same as a double. The unsigned keyword can also be used as an adjective. An unsigned short or unsigned char is a 16- or 8-bit unsigned integer, respectively.
Additional information available:
ArrayenumPointerStructuretypedefUnionVoid
Array
An array is an aggregate of subscripted elements of the same type.
Elements of an array can have one of the fundamental data types or
can be structures, unions, or other arrays (multidimensional
arrays). An array is declared using square brackets. For example:
int array1[10];
declares array1 to be an array of 10 integers. The valid
subscripts for array1 range from 0 to 9. For another example:
int array2[2][3];
declares array2 to be a two-dimensional (2 by 3) array of integers.
The elements are stored in row-major order:
array2[0][0], array2[0][1], ... array2[1][2].
enum
Enumerated types are sets of scalar objects that have type names.
Variables are declared with "enum-specifiers" in the place of the
type specifier. The forms of enum-specifier are:
enum { enumerator,... }
or
enum tag { enumerator,... }
or
enum tag
Each enumerator defines a constant of the enumerated type (tag).
The enumerator list forms an ordered list of the type's values.
Each enumerator has the form "identifier [= expression]", where the
"identifier" is the name to be used for the constant value and the
optional "expression" gives its integer equivalent. If a tag
appears but no list of enumerators, the enum-specifier refers to a
previous definition of the enumerated type, identified by the tag.
Pointer
A pointer in C is a variable that holds the address of another
variable. Pointers are declared with the asterisk operator:
int i, *ip, *np; /* i IS AN INTEGER, ip AND np ARE
POINTERS TO INTEGERS */
The following operations are permitted on pointers:
o Assigning an address to the pointer (as in ip = &i;)
o Fetching the object of the pointer (by dereferencing the
pointer) with the asterisk operator (i = *ip;, which assigns the
addressed integer to i)
o Adding (as in ip += 5;, which makes ip point to the object that
is five longwords away from the initial address in ip)
o Subtracting (as in i = np - ip;, which gives the number of
objects separating the objects pointed to by np and ip)
Structure
A structure is an aggregate of members whose data types can differ.
Members can be scalar variables, arrays, structures, unions, and
pointers to any object. The size of a structure is the sum of the
sizes of its members, which are stored in the order of their
declarations. Structures are defined with the keyword struct,
followed by an optional tag, followed by a structure-declaration
list in braces:
struct [identifier] { struct-declaration ... }
Each struct-declaration is a type specifier (type keyword, struct
tag, union tag, enum tag, or typedef name) followed by a list of
member declarators:
type-specifier member-declarator,... ;
Each member declarator defines either an ordinary variable or a bit
field:
declarator
or
[declarator] : constant-expression
typedef
The keyword typedef is used to define an abbreviated name, or
synonym, for a lengthy type definition. Grammatically, the word
typedef is a storage-class specifier, so it can precede any valid
declaration. In such a declaration, the identifiers name types
instead of variables. For example:
typedef char CH, *CP, STRING[10], CF();
In the scope of this declaration, CH is a synonym for "character,"
CP for "pointer to character," STRING for "10-element array of
characters," and CF for "function returning a character." Each of
the type definitions can be used in that scope to declare
variables, as in:
CF c; /* c IS A FUNCTION RETURNING A CHARACTER */
STRING s; /* s IS A 10-CHARACTER STRING */
Union
A union is an aggregate of members whose data types can differ.
Members can be scalar variables, arrays, structures, unions, and
pointers to any object. The size of a union is the size of its
longest member; all its members occupy the same storage. Unions
are defined with the keyword union, followed by an optional tag,
followed by a union-declaration list in braces:
union [identifier] { union-declaration ... }
Each union-declaration is a type specifier (type keyword, struct
tag, union tag, enum tag, or typedef name) followed by a list of
member declarators:
type-specifier member-declarator,... ;
Each member declarator defines either an ordinary variable or a bit
field:
declarator
or
[declarator] : constant-expression
Void
The void data type can be used to declare functions that do not return a value. Functions declared to be of this type cannot contain return statements and cannot be used in statements where a return value is expected. The void data type can be used in the cast operation if casting to a "function without a return value ..." The void data type can also be used with pointers.
Declarations
Declarations specify the functions and variables referenced in the
program. Declarations in C have the form:
declaration ::=
decl-specifier ... [init-declarator,...] ;
decl-specifier ::=
type-specifier [decl-specifier,...]
sc-specifier [decl-specifier,...]
dm-specifier [decl-specifier,...]
"decl-specifiers" give the data types and, optionally, storage
classes of the declared objects. "init-declarators" list the
declared identifiers and, optionally, their initial values.
For more information, see HELP CC lANGUAGE_TOPICS DATA_TYPES, HELP
CC LANGUAGE_TOPICS STORAGE_CLASSES, HELP CC LANGUAGE_TOPICS
DATA_TYPE_MODIFIERS.
Additional information available:
Interpretation
The symbols used in declarations are VAX C operators, subject to
the usual rules of precedence and associativity. These operators
are parentheses, brackets, and asterisks for "function
returning...", "array of...", and "pointer to...", respectively.
Parentheses and brackets associate left to right; asterisk
operators associate right to left. Parentheses and brackets have
the same precedence, which is higher than that of asterisks.
Parentheses are also used to change the associativity of the other
operators. For example:
char * ( *x() ) [];
* ( *x() ) [] is char
( *x() ) [] is (pointer to) char
*x() is (array of) (pointer to) char
x() is (pointer to) (array of) (pointer to)
char
x is (function returning) (pointer to)
(array of) (pointer to) char
In this sort of breakdown, lower precedence operators are removed
first. With two equal precedence operators, you remove the
rightmost if they are left-to-right operators, and the leftmost if
they are right-to-left operators. For instance, "[]()" means
"array of functions returning...."
Functions
Functions consist of one or more blocks of statements that perform
one logical operation. They can be called from other functions
either in the same program or in different programs. A function
may exchange values with the calling function by use of parameters.
Function declarations have the form:
function_name()
or
function_name(arg1,arg2,...)
or
function_name(data-type arg1, data-type arg2,...)
In the first form of the function declaration, the function takes
no arguments. In the second form, the function takes arguments.
In the third form, the function declaration is a function prototype
that specifies the data type of its arguments in the identifier
list. In all three cases, the parenthesis after the function name
are required.
VAX C provides a library of common functions. These functions
perform standard I/O operations, character and string handling,
mathematical operations, miscellaneous system services, and UNIX*
system emulation.
See also HELP CC RUN-TIME_FUNCTIONS.
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
Additional information available:
Variable Length Argument Lists
Variable Length Argument Lists
The set of functions defined and declared in the varargs definition
module provide a portable method of accessing variable length
argument lists.
The function header va_alist, the definition va_dcl, and the type
va_list are used to declare the argument list and the variable that
is used to traverse the list. The header va_alist is a parameter
in the function definition; va_dcl declares the parameter va_alist
(va_dcl is a definition which is not terminated with a semi-colon
(;).); and, the type va_list declares the variable used to traverse
the list. You must declare at least one incrementing variable of
type va_list when using varargs. The syntax of these headers and
declarations is as follows:
function_name(va_alist);
va_dcl
va_list list_incrementor;
There are five RTL macros used to manipulate variable length
argument lists. In order to use them, you must include the varargs
definition module. The five functions are as follows:
va_start The macro va_start initializes the variable
list_incrementor to the beginning of the argument list.
For more information, refer to "HELP CC
RUN-TIME_FUNCTIONS VA_START".
va_start_1 The macro va_start_1 initializes the variable
list_incrementor to the beginning of the argument list
if there are other arguments which precede the variable
length argument list. For more information, refer to
"HELP CC RUN-TIME_FUNCTIONS VA_START_1".
va_arg The macro va_arg returns the next item in the argument
list. The function must determine the type of the
returned item. For more information, refer to "HELP CC
RUN-TIME_FUNCTIONS VA_ARG".
va_count The macro va_count returns the number of longwords
contained in the argument list. The function is
responsible for knowing whether or not a single argument
is larger than a single longword. For more information,
refer to "HELP CC RUN-TIME_FUNCTIONS VA_COUNT".
va_end The macro va_end terminates the varargs session. You
may traverse an argument list more than once. For more
information, refer to "HELP CC RUN-TIME_FUNCTIONS
VA_END".
Preprocessor
The VAX C "preprocessor" uses directives to affect the compilation of a source file. In VAX C, these directives are processed by an early phase of the compiler, not by a separate program. The preprocessor directives begin with a number sign (#) and do not end with a semicolon. The number sign must appear in the first column of the source line.
Additional information available:
Conditional Compilation#define#dictionary#include#line#module
#pragma#undef
Conditional Compilation
Conditional compilation is provided by the directives:
#if constant-expression
Checks whether the constant expression is nonzero (true)
#ifdef identifier
Checks whether the identifier is defined
#ifndef identifier
Checks whether the identifier is undefined
#else
Introduces source lines to be compiled as an alternative to the
conditions tested by the above directives
#elif constant-expression
Delimits alternative source lines to be compiled if the constant
expression in the corresponding #if, #ifdef, or #ifndef
directive is false and if the additional constant expression
presented in the #elif line is true. An #elif directive is
optional.
#endif
Ends the scope of the above directives
If the condition checked by #if, #ifdef, or #ifndef is true, then
all lines between the #else, #elif, and #endif are ignored. If the
condition is false, then any lines between the conditional
directive and the #else or #elif (if any) are ignored. If there is
no #else, then the lines between the conditional and the #endif are
ignored.
#define
The #define preprocessor directive has the form:
#define identifier token-string
The preprocessor substitutes the token string everywhere in the
program that it finds the identifier except within comments,
character constants, or string constants.
Macro replacements are defined in a #define directive of the form:
#define name([parm1[,parm2,...]]) token-string
Within the program, all macro references that have the form
name([arg1[,arg2,...]])
are replaced by the token string. The arguments in the macro
reference replace the corresponding parameters in the token string.
#dictionary
The #dictionary directive extracts Common Data Dictionary (CDD)
definitions from the specified dictionary. These definitions are
then translated into VAX C and included in the program.
The #dictionary directive has the form:
#dictionary "cdd_path"
The "cdd_path" is a character string that gives the pathname of the
CDD record. It can also be a macro that resolves to such a
character string.
#include
The #include directive instructs the preprocessor to insert the
contents of the specified file or module into the program. An
#include directive can have one of three forms:
#include "filespec"
#include <filespec>
#include module-name
Each form is interpreted differently by the compiler. For the
quoted form, the order of search is as follows:
1. The directory containing the source file.
2. The directories specified in the /INCLUDE qualifier (if any).
3. The directory or search list of directories specified in the
logical name C$INCLUDE (if any).
For the bracketed form, the order of search is as follows:
1. The directories specified in the /INCLUDE qualifier (if any).
2. The directory or search list of directories specified in the
logical name VAXC$INCLUDE (if any).
3. If VAXC$INCLUDE is not defined, then the directory or search
list of directories specified by SYS$LIBRARY.
In the first two forms, .H is the default file type.
There is no defined limit to the nesting level of #include files
and modules.
#line
The #line directive applies a specified line number and file
specification to the next line of source text. This can be useful
for diagnostic messages. The #line directive has the forms:
#line constant identifier
#line constant string
# constant identifier
# constant string
The constant gives the line number to be applied to the next line
of source text in diagnostics reported to the terminal, not to the
compiler listing file. It must be a nonsigned integer. The second
argument supplies the file specification. It can be either a VAX C
identifier or a character-string constant (not to exceed 255
characters).
#module
The #module directive passes information about an object module to
the compiler.
The #module directive can have one of three forms:
#module identifier
#module identifier identifier
#module identifier string
The first argument of the directive is a VAX C identifier or macro
that resolves to an identifier. It gives the system-recognized
(for example, internally recognized by the debugger and the
librarian) name of the module; the object file name remains the
same. The second argument specifies the optional identification
that appears on listings. This may be either a VAX C identifier, a
character-string constant with no more than 31 characters, or a
macro that resolves to one of these.
There can be only one #module directive per compilation. It can
appear anywhere before the VAX C language text.
#pragma
The #pragma directive performs tasks as designated by the particular implementation of the C language. Note that there are no such tasks currently defined for VAX C.
#undef
The #undef directive cancels a previously defined token
replacement. Any other token replacements that occurred prior to
the #undef directive remain.
The #undef directive has the form:
#undef identifier
Predefined tokens
The VAX C compiler has predefined tokens and macros for use in programs.
Additional information available:
VAXVAXCVAX11C__DATE____FILE____LINE____TIME__
vax
This symbol is defined as the constant 1 and may be used in #elif, #if, #ifdef, and #ifndef directives to separate portable and nonportable code in any of your VAX C programs.
VAX
This symbol is defined as the constant 1 and may be used in #elif, #if, #ifdef, and #ifndef directives to separate portable and nonportable code in any of your VAX C programs.
vms
This symbol is defined as the constant 1 and may be used in #elif, #if, #ifdef, and #ifndef directives to separate portable and nonportable code in any of your VAX C programs.
vaxc
This symbol is defined as the constant 1 and may be used in #elif, #if, #ifdef, and #ifndef directives to separate portable and nonportable code in any of your VAX C programs.
VAXC
This symbol is defined as the constant 1 and may be used in #elif, #if, #ifdef, and #ifndef directives to separate portable and nonportable code in any of your VAX C programs.
vax11c
This symbol is defined as the constant 1 and may be used in #elif, #if, #ifdef, and #ifndef directives to separate portable and nonportable code in any of your VAX C programs.
VAX11C
This symbol is defined as the constant 1 and may be used in #elif, #if, #ifdef, and #ifndef directives to separate portable and nonportable code in any of your VAX C programs.
CC$gfloat
The CC$gfloat definition may be used if you compile your VAX C program using the /G_FLOAT qualifier. If you specify the /G_FLOAT qualifier, CC$gfloat is defined as 1. You can also use this definition if you did not compile your VAX C program using the /G_FLOAT qualifier. When you do not specify the /G_FLOAT qualifier, CC$gfloat is defined as zero.
__DATE__
The __DATE__ macro evaluates to a string specifying the date on which the compilation started. The string presents the date in the form dd-mmm-yyyy.
__FILE__
The __FILE__ macro evaluates to a string specifying the file specification of the current source file.
__LINE__
The __LINE__ macro evaluates to an integer specifying the number of the line in the source file containing the macro reference.
__TIME__
The __TIME__ macro evaluates to a string specifying the time at which the compilation started. The string presents the time in the form hh:mm:ss.
Statements
Statements are the executable instructions performed by the program. Statements produce values and control program flow. A group of statements enclosed in braces makes up a block. Any valid expression or declaration terminated by a semi-colon is considered a statement. The statements that control program flow are described in further HELP frames. See also HELP CC LANGUAGE_TOPICS DECLARATION and HELP CC LANGUAGE_TOPICS PREPROCESSOR.
Additional information available:
breakcontinuedoentryforgotoif
LabeledNullreturnswitchwhile
break
The break statement terminates the immediately enclosing while, do,
for, or switch statement. Control passes to the statement
following the terminated statement. The break statement has the
form:
break ;
continue
The continue statement passes control to the test portion of the
immediately enclosing while, do, or for statement. It has the
form:
continue ;
In each of the following statements, a continue is equivalent to
"goto label;":
while (expression) { statement ... label: ; }
do { statement ... label: ; } while (expression);
for (expression; expression; expression)
{ statement ... label: ; }
Continue is not intended for switches. A continue inside a switch
inside a loop causes reiteration of the loop.
do
The do statement executes a statement one or more times, as long as
a stated condition expression is true:
do statement while ( expression ) ;
The statement is always executed at least once. The expression is
evaluated after each execution of the statement. If the expression
is not zero, the statement is executed again. Note that the
statement following the do keyword (the "body" of the do statement)
is not optional; the null statement (a lone semicolon) is provided
for specifying a do statement with an empty body.
entry
Although VAX C has no entry statement, the word "entry" is a keyword reserved for future use by DIGITAL. It may not be used.
for
The for statement executes a statement zero or more times, with
three specified control expressions. Expression-1 is evaluated
only once, before the first iteration; expression-2 is evaluated
before every iteration; expression-3 is evaluated after every
iteration. The for loop terminates if, on evaluation, expression-2
is zero. The format of the for statement is:
for ( [expression-1] ; [expression-2] ; [expression-3] )
statement
The for statement is equivalent to:
expression-1;
while ( expression-2 ) { statement expression-3; }
Any of the three expressions can be omitted. If expression-2 is
omitted, the "while" condition always is true.
goto
The goto statement transfers control unconditionally to a labeled
statement:
goto identifier ;
The identifier must be a label located in the current function.
Goto may be used to branch into a block, but no initializations are
performed on variables declared in the block.
if
The if statement is a conditional statement. It can be written
with or without an else clause:
if ( expression ) statement
if ( expression ) statement else statement
In both cases, the expression is evaluated, and if it is not zero,
the first statement is executed. If the else clause is included
and the expression is zero, the statement following else is
executed instead. In a series of if-else clauses, the else matches
the most recent else-less if.
Labeled
Any statement can be preceded by a label prefix of the form:
identifier:
which declares the identifier as a label. The scope of such a
declaration is the current function. Labels are used only as the
targets of goto statements.
Null
A null statement is a semicolon:
;
The null statement is used to provide a null action -- for example,
the body of a for loop that takes no action:
for(i=0; i < ARRAYSIZE && x[i] == 5; i++)
;
return
The return statement causes a return from a function, with or
without a return value:
return ;
return expression ;
The return value is undefined if not specified in a return
statement. If an expression is specified in the return statement,
it is evaluated and the value is returned to the calling function;
the value is converted, if necessary, to the type with which the
called function was declared. If a function does not have a return
statement, the effect (on reaching the end of the function) is the
same as with a return statement that does not specify an
expression. Functions declared as void may not contain return
statements specifying an expression.
switch
The switch statement executes one or more of a series of cases,
based on the value of an integer expression:
switch ( expression ) body
The switch's body typically is a block, within which any statement
can be prefixed with one or more case labels:
case constant-expression :
At most one statement in the body may have the label:
default :
The switch expression is evaluated and compared to the cases. If
there is a case matching the expression's value, it is executed; if
not, the default case is executed. The switch is normally
terminated by a break, return, or goto statement in one of the
cases. If there is no matching case and no default, the body of
the switch statement is skipped.
while
The while statement executes a statement zero or more times, as
long as a stated condition is true:
while ( expression ) statement
The expression is evaluated before each execution, and the
statement is executed if the expression is not zero. Note that the
statement following the parentheses (the "body" of the while
statement) is not optional; the null statement (a lone semicolon)
is provided for specifying a while statement with an empty body.
Storage Classes
The storage class of a variable determines when its storage is allocated, whether its contents are preserved across different blocks or functions, and what link-time scope the variable has. Auto variables are allocated at run time. They are not preserved across functions. Auto is the default storage class for variables declared within a function. Extern variables are allocated at compile time. They are preserved across functions. There can be only 65,532 extern variables per program. Extern is the default storage class for variables declared outside a function. Globaldef, globalref, and globalvalue variables are allocated at compile time. They are preserved across functions. The number of global symbols is unlimited. Register variables are allocated at run time. They cannot be referenced from other separately compiled functions. Static variables are allocated at compile time. If externally declared, they retain their values across functions. If internally declared (inside of a function), they cannot be referenced from other functions; if control passes from the defining function, to other functions, and then passed back to the defining function, the variable retains its previous value and is not reinitialized.
Data type modifiers
Data type modifiers affect the allocation or access of data storage. The data type modifiers are const and volatile.
Additional information available:
const
The const data type modifier restricts access to stored data. If
you declare an object to be of type const, you cannot modify that
object. The const modifier can be use with the data type modifier
volatile or with any of the storage class specifiers or modifiers.
The following example declares the variable x to be a constant
integer.
int const x;
volatile
The volatile data type modifier prevents an object from being stored in a machine register, forcing it to be allocated in memory. This data type modifier is useful for declaring data that is to be accessed asynchronously. A device driver application often uses volatile data storage. Like const, you can specify the volatile data type modifier with any of the storage class specifiers or modifiers with the exception of the register storage class.
Storage class modifiers
The storage class modifiers allow individual attributes of a
variable to change without changing the other default attributes
connected with a given storage class. Storage class keywords and
storage class modifiers can be specified in either order.
modifier storage_class_keyword identifier;
The modifiers can be used alone; in this case, the default storage
class is extern.
Additional information available:
noshare
Noshare variables are assigned the PSECT attribute NOSHR. Noshare
variables may not be shared between processes. This modifier is
used when linking variables that are not to be shared within a
shareable image. The noshare modifier can be used with the storage
class keywords static, [extern], globaldef, and globaldef{"name"}.
readonly
Readonly variables are assigned the PSECT attribute NOWRT and are
stored in the PSECT $CODE, which is a non-writeable data area.
Other programs can access the PSECT directly, but none of the
information can be overwritten. The readonly modifier can be used
with the storage class keywords [extern], static, globaldef, and
globaldef{"name"}.
You can use both the readonly and noshare modifiers with the
[extern] and the globaldef{"name"} specifiers. If you use both
modifiers with either the static or the globaldef specifiers, the
compiler ignores noshare and accepts readonly.
align
The _align modifier allows you to align objects of any of the VAX C data types on a specified storage boundary. You use the _align modifier in a data declaration or defintion. When specifying the boundary of the data alignment, you can use a predefined constant. VAX C predefined alignment constants include BYTE or byte, WORD or word, LONGWORD or longword, QUADWORD or quadword, OCTAWORD or octaword, and PAGE or page. You can also specify an integer value that is a power of two. The power of two tells VAX C the number of bytes to pad in order to align the data.
Link libraries
You are to define the logicals LNK$LIBRARY_n as the libraries
SYS$LIBRARY:VAXCCURSE, SYS$LIBRARY:VAXCRTLG, and
SYS$LIBRARY:VAXCRTL. Depending on the needs of your program, you
may have to access one, two, or all three libraries. In any case,
you must adhere to the following rules for defining libraries for
the linker to search:
1. If you do not need to use the Curses Screen Management package
of VAX C RTL functions and macros, and you do not use the
/G_FLOAT qualifier on the CC command line, you must define the
logical as follows:
$ DEFINE LNK$LIBRARY SYS$LIBRARY:VAXCRTL
2. If you plan to use the /G_FLOAT qualifier with the CC command
line, but do not plan on using Curses, you must define the
logicals as follows:
$ DEFINE LNK$LIBRARY SYS$LIBRARY:VAXCRTLG
$ DEFINE LNK$LIBRARY_1 SYS$LIBRARY:VAXCRTL
3. If you plan to use the Curses Screen Management package, but do
not plan to use the /G_FLOAT qualifier, you must define the
logicals as follows:
$ DEFINE LNK$LIBRARY SYS$LIBRARY:VAXCCURSE
$ DEFINE LNK$LIBRARY_1 SYS$LIBRARY:VAXCRTL
4. Finally, if you plan to use both Curses and the /G_FLOAT
qualifier, you must define the three logicals in the following
order:
$ DEFINE LNK$LIBRARY SYS$LIBRARY:VAXCCURSE
$ DEFINE LNK$LIBRARY_1 SYS$LIBRARY:VAXCRTLG
$ DEFINE LNK$LIBRARY_2 SYS$LIBRARY:VAXCRTL
Do NOT use search lists to define the equivalence names for
LNK$LIBRARY_n. The linker will not resolve external references to
the VAX C RTL functions in the proper manner.
Using the object code of the VAX C RTL functions is one of two
options. You can also use the VAX C RTL as a shared image to
reduce the space your program's image takes on disk and to increase
its execution rate. For information concerning the shared-image
option, refer to the VAX C Run-Time Library Reference Manual.
Run-time functions
In the Curses Screen Management Package, there are pairs of
functions and macros with equivalent functionality. Many Curses
functions and macros are expressed as follows:
[w]addch
[no]echo
The descriptions of the macro, ADDCH, and the function, WADDCH, are
found under the heading, [W]ADDCH. The descriptions of the macros
ECHO and NOECHO are found under the heading, [NO]ECHO. For more
information concerning Curses Screen management functions and
macros, refer to "HELP CC RUN-TIME_FUNCTIONS CURSES" and "HELP CC
LINK_LIBRARIES."
All other VAX C Run-time Library functions are listed under
separate headings.
Additional information available:
abortabsaccessacos[w]addch[w]addstralarm
asctimeasinassertatanatan2atexitatof
atoiatolboxbrkbsearchcabscalloc
ceilcfreechdirchmodchown[w]clearclearerr
clearokclockclose[w]clrattr[w]clrtobot[w]clrtoeolcos
coshcreat[no]crmodectermidctimeCursescuserid
[w]delchdelete[w]deletelndelwindifftimedivdup
dup2[no]echoecvtendwin[w]eraseexeclexecle
execlpexecvexecveexecvpexitexpfabs
fclosefcvtfdopenfeofferrorfflushfgetc
fgetnamefgetposfgetsfilenofloorfmodfopen
fprintffputcfputsfreadfreefreopenfrexp
fscanffseekfsetposfstatftellftimefwrite
gcvtgetc[w]getchgetchargetcwdgetegidgetenv
geteuidgetgidgetnamegetpidgetppidgets[w]getstr
getuidgetwgetyxgmtimegsignalhypot[w]inch
initscr[w]insch[w]insertln[w]insstrisalnumisalphaisapipe
isasciiisattyiscntrlisdigitisgraphislowerisprint
ispunctisspaceisupperisxdigitkillldexpldiv
leaveoklocaltimeloglog10longjmplongnamelseek
mallocmemchrmemcmpmemcpymemsetmkdirmktemp
modf[w]movemv[w]addchmv[w]addstrmvcurmv[w]delchmv[w]getch
mv[w]getstrmv[w]inchmv[w]inschmv[w]insstrmvwinnewwinnice
[no]nlopenoverlayoverwritepauseperrorpipe
powprintf[w]printwputcputcharputsputw
qsortrand[no]rawreadrealloc[w]refreshremove
renamerewindsbrkscanf[w]scanwscrollscrollok
[w]setattrsetbufsetgidsetjmpsetuidsetvbufsigblock
signalsigpausesigsetmasksigstacksigvecsinsinh
sleepsprintfsqrtsrandsscanfssignal[w]standend
[w]standoutstatstrcatstrchrstrcmpstrcpystrcspn
strerrorstrlenstrncatstrncmpstrncpystrpbrkstrrchr
strtodstrtokstrtolstrtoulstrspnsubwinsystem
tantanhtimetimestmpfiletmpnamtoascii
tolowertouchwintoupperttynameumaskungetcva arg
va countva endva startva start 1vforkvprintf, vfprintf, vsprintf
waitwrapokwrite
abort
Terminates the process.
Syntax:
abort()
abs
Returns the absolute value of an integer.
Syntax:
int abs(int integer);
access
Checks a file to see if a specified access mode is allowed.
Syntax:
int access(char *name, int mode);
acos
Returns a value in the range 0 to pi, which is the arc cosine of
the radian argument.
Syntax:
#include math
double acos(double x);
[w]addch
Curses Screen Management function and macro which add a single
character to a specified window on the terminal screen.
Syntax:
#include curses
addch(char ch)
waddch(WINDOW *win, char ch);
[w]addstr
Curses Screen management function and macro which add a string to a
specified window on the terminal screen.
Syntax:
#include curses
addstr(char *str)
waddstr(WINDOW *win, char *str);
alarm
Sends the signal SIGALRM to the invoking process after the number
of seconds specified.
Syntax:
#include signal
int alarm(unsigned seconds);
asctime
Converts the broken-down time passed in a predefined structure form
into a string.
Syntax:
#include time
char *asctime (const tm_t, *timeptr);
asin
Returns a value in the range -pi/2 to pi/2, which is the arc sine
of its radian argument.
Syntax:
#include math
double asin(double x);
assert
Verifies a program assertion.
Syntax:
#include assert
void assert (int expression);
atan
Returns a value in the range -pi/2 to pi/2, which is the arc
tangent of its radian argument.
Syntax:
#include math
double atan(double x);
atan2
Returns a value in the range -pi/2 to pi/2, which is the arc
tangent of x/y, where x and y are the double arguments.
Syntax:
#include math
double atan2(double x, double y);
atexit
Registers a function that will be called without arguments at
program termination.
Syntax:
#include stdlib
void atexit (void (*func) (void));
atof
Converts an ASCII string to a numeric value. The ASCII string has
the form:
[white-spaces][+|-]digits[.digits][e|E[+|-]integer]
The first unrecognized character ends the string. This function
does not account for overflow resulting from the conversion.
Syntax:
#include math
double atof(char *nptr);
atoi
Converts an ASCII string to a numeric value. The ASCII string has
the form:
[white-spaces][+|-]digits
This function does not account for overflow resulting from the
conversion.
atoi is the same as atol in VAX C.
Syntax:
#include stdlib
int atoi(char *nptr);
atol
Converts an ASCII string to a numeric value. The ASCII string has
the form:
[white-spaces][+|-]digits
The function does not account for overflow resulting from the
conversion.
atol is the same as atoi in VAX C.
Syntax:
#include stdlib
long atol(char *nptr);
box
Curses Screen Management function which draws a rectangular box
around a specified window with the specified characters on the
borders.
Syntax:
#include curses
box(WINDOW *win, char vert, char hor);
brk
brk defines the break for the current image process and returns the
old break value.
Syntax:
char *brk(unsigned addr);
bsearch
Performs a binary search on a sorted table.
Syntax:
#include stdlib
void *bsearch (const void *key,
const void *base,
size_t nmemb,
size_t size,
int (*compar) (const void *, const void *));
cabs
Returns sqrt(x*x + y*y).
Syntax:
#include math
double cabs(cabs_t z);
calloc
Allocates space for an area in memory.
Syntax:
char *calloc(unsigned number, unsigned size);
ceil
Returns the smallest integer (as a double) that is equal to or
greater than its argument.
Syntax:
#include math
double ceil(double x);
cfree
Deallocates the area allocated by calloc, malloc, or realloc.
Traditionally, cfree is used with calloc; free is used with malloc.
However, in VAX C, the cfree and free functions are the same.
Syntax:
#include stdlib
int cfree(char *pointer);
chdir
Changes the default directory.
Syntax:
int chdir(char *name);
chmod
Changes a file protection.
Syntax:
int chmod(char *name, unsigned mode);
chown
Changes the owner UIC of a file.
Syntax:
int chown(char *name, unsigned owner, unsigned group);
[w]clear
Curses Screen management function and macro which erase the
contents of the specified window on the terminal screen.
Syntax:
#include curses
clear(void)
wclear(WINDOW *win);
clearerr
Resets the error and end-of-file indicators for a file.
Syntax:
#include stdio
clearerr(FILE *file_pointer);
clearok
Curses Screen Management function which, if boolf is true, allows a
specified window to be cleared the next time the function
[w]refresh is called.
Syntax:
#include curses
clearok(WINDOW *win, bool boolf);
clock
Determines the amount of CPU time used
Syntax:
#include time
clock_t clock(void);
close
Closes a file; used with open and creat.
Syntax:
#include unixio
int close(int file_descriptor);
[w]clrattr
Curses Screen management function and macro which deactivate the
video display attributes boldface, blinking, reverse video, and
underlining within a specified window on the terminal screen. The
attributes are represented by _BOLD, _BLINK, _REVERSE, and
_UNDERLINE.
Syntax:
#include curses
clrattr(unsigned attr)
wclrattr(WINDOW *win, attr);
[w]clrtobot
Curses Screen management function and macro which clear the
specified window from the current position of the cursor to the end
of the window.
Syntax:
#include curses
clrtobot(void)
wclrtobot(WINDOW *win);
[w]clrtoeol
Curses Screen management function and macro which clear the
specified window from the current position of the cursor to the end
of the line.
Syntax:
#include curses
clrtoeol(void)
wclrtoeol(WINDOW *win);
cos
Returns the cosine of its radian argument.
Syntax:
#include math
double cos(double x);
cosh
Returns the hyperbolic cosine of its argument.
Syntax:
#include math
double cosh(double x);
creat
Creates or prepares to rewrite a file by file descriptor.
Syntax:
#include unixio
int creat(char *name, unsigned mode [,char
*file_attribute,...])
[no]crmode
Curses Screen management macros which set and unset the terminal
from cbreak mode; these functions are provided only for portability
with UNIX* systems. Setting CRMODE also sets NONL.
Syntax:
#include curses
crmode(void)
nocrmode(WINDOW *win)
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
ctermid
Returns the name of the controlling terminal.
Syntax:
#include stdio
char *ctermid(char *string);
ctime
Converts the time in seconds to the form:
wkd mmm dd hh:mm:ss 19yy\n\0
Syntax:
#include time
char *ctime(long *bintim);
Curses
Curses, the VAX C Screen Management Package, is comprised of VAX C RTL functions that create and modify defined sections of the terminal screen, and optimize cursor movement. Using a screen management package, you can develop a user interface that is both visually attractive and easy to use. Curses allows manipulation of the screen without worry about the intricacies of various types of terminals, the difficulties of moving data to and from sections of the screen, or the problems of efficient cursor movement. Using Curses, the terminal screen may be divided into a number of rectangular regions called windows. The size and location of each window is given in terms of the number of lines, the number of columns, and the starting position --- the upper left corner of the window. A window must fit completely on the terminal screen, being as small as a single character or as large as the entire terminal screen. When modifying windows, changes will not appear on the terminal screen until the window is refreshed. When a window is refreshed, the updated window is placed onto the terminal screen leaving the rest of the terminal screen unaltered.
cuserid
Returns the name of the user who initiated the current process.
Syntax:
#include stdio
char *cuserid(char *string);
[w]delch
Curses Screen management function and macro which delete a single
character from the specified window on the terminal screen.
Syntax:
#include curses
delch(void)
wdelch(WINDOW *win);
delete
Deletes a file by file specification. The delete function is
unique to VAX C.
Syntax:
#include unixio
int delete(char *file_specification);
[w]deleteln
Curses Screen management function and macro which remove a line
from the specified window at the current position of the cursor and
move all lower lines upward.
Syntax:
#include curses
deleteln(void)
wdeleteln(WINDOW *win);
delwin
Curses Screen Management function which removes a specified window
from the terminal screen.
Syntax:
#include curses
delwin(WINDOW *win);
difftime
Computes the difference of two specified times.
Syntax:
#include time
double difftime (time_t time1, time_t time_2);
div
Returns the quotient and remainder after the division of its
arguments.
Syntax:
#include stdlib
div_t div(int numer, int denom);
dup
Creates a new file descriptor for an existing file.
Syntax:
#include unixio
int dup(int file_descriptor);
dup2
Makes file_descriptor_2 point to the same file as
file_descriptor_1.
Syntax:
#include unixio
int dup2(int file_descriptor_1, int file_descriptor_2);
[no]echo
Curses Screen management macros which set the terminal so that
characters may or may not be echoed on the terminal screen.
Syntax:
#include curses
echo(void)
noecho(void)
ecvt
Converts a double value to a NUL-terminated string of ASCII digits
and returns the address of the string.
Syntax:
char *ecvt(double value, int ndigit,*decpt,*sign)
endwin
Curses Screen Management function which clears the terminal screen
and ends the Curses editing session.
Syntax:
#include curses
endwin()
[w]erase
Curses Screen management function and macro which erase a specified
window on the terminal screen by "painting" it with blanks, leaving
the cursor in the current position.
Syntax:
#include curses
erase(void)
werase(WINDOW *win);
execl
Executes the image in the named file. The arguments to execl are
the file name and character strings giving the arguments to the
called image. The argument list must end with 0.
Syntax:
#include processes
int execl (char *file-spec, char *argn,...);
execle
Executes the image in the named file. The arguments to execle are
the name of the file, character strings containing the arguments
for the called image, and an array of strings that specify the
program's environment. The strings in the environment array have
the form:
HOME the user's login directory
TERM the type of the terminal
PATH the default device and directory
USER the name of the user initiating the current process
The strings for the environment array can be retrieved with the
getenv function.
Syntax:
#include processes
int execle (char *file-spec, char *argn,...);
execlp
Executes the image in the named file. The arguments to execlp are
the name of the file, character strings containing the arguments
for the called image, and an array of strings that specify the
program's environment. The strings in the environment array have
the form:
HOME the user's login directory
TERM the type of the terminal
PATH the default device and directory
USER the name of the user initiating the current process
The strings for the environment array can be retrieved with the
getenv function.
Syntax:
#include processes
int execlp (char *file-spec, char *argn,...);
execv
Executes the image in the named file. The arguments to execv are
the name of the file and an array of strings giving the arguments
to the called image. The last element of the array must be 0.
Syntax:
#include processes
int execv (char *file-spec, char *argv[]);
execve
Executes the image in the named file. The arguments to execve are
the file name, an array of strings containing the arguments to the
called image, and an environment array. The strings in the
environment array have the form:
HOME the user's login directory
TERM the type of the terminal
PATH the default device and directory
USER the name of the user initiating the current process
The strings for the environment array can be retrieved with the
getenv function.
Syntax:
#include processes
int execve (char *file-spec, char *argv[], char *envp[]);
execvp
Executes the image in the named file. The arguments to execvp are
the name of the file, character strings containing the arguments
for the called image, and an array of strings that specify the
program's environment. The strings in the environment array have
the form:
HOME the user's login directory
TERM the type of the terminal
PATH the default device and directory
USER the name of the user initiating the current process
The strings for the environment array can be retrieved with the
getenv function.
Syntax:
#include processes
int execvp (char *file-spec, char *argv[]);
exit
Terminate the calling process. exit flushes and closes all open
files before terminating the process; _exit does not.
Syntax:
#include stdlib
void exit(int status)
_exit(int status);
exp
Returns the base e raised to the power of the argument.
Syntax:
#include math
double exp(double x);
fabs
Returns the absolute value of a floating-point value.
Syntax:
#include math
double fabs(double x);
fclose
Closes a file; used with fopen.
Syntax:
#include stdio
int fclose(FILE *file_pointer);
fcvt
Converts a double value to a NUL-terminated string of ASCII digits
and returns the address of the string.
Syntax:
char *fcvt(double value,int ndigit, int *decpt, int *sign);
fdopen
Associates a file pointer with a file descriptor.
Syntax:
#include stdio
FILE *fdopen(int file_descriptor,char *type);
Types are "r" (read), "w" (write), "a" (append), "r+" (read
update), "w+" (write update), and "a+" (append update).
feof
Tests for end-of-file.
Syntax:
#include stdio
int feof(FILE *file_pointer);
ferror
Indicates if an error occurred during a read or write of the file.
Syntax:
#include stdio
int ferror(FILE *file_pointer);
fflush
Writes out any buffered information to the file.
Syntax:
#include stdio
int fflush(FILE *file_pointer);
fgetc
Returns the next character from the file. getc is implemented as a
macro. fgetc generates a function call.
Syntax:
#include stdio
int fgetc(FILE *file_pointer);
fgetname
Returns the VAX/VMS file specification associated with the
specified file pointer. The fgetname function is unique to VAX C.
Syntax:
#include stdio
char *fgetname(FILE *file_pointer,char *buffer);
fgetpos
Returns the current file position.
Syntax:
#include stdio
int fgetpos(FILE *file_pointer, fpos_t *fpos);
fgets
Reads a line from a file until it reads either a newline or the
specified maximum number of characters. fgets terminates the line
with a NUL character.
Syntax:
#include stdio
char *fgets(char *string, int maxline, FILE *file_pointer);
fileno
Returns an integer file descriptor.
Syntax:
#include stdio
int fileno(FILE *file_pointer);
floor
Returns (as a double) the largest integer that is less than or
equal to its argument.
Syntax:
#include math
double floor(double x);
fmod
Computes the floating-point remainder of the first argument to fmod
divided by the second. If the quotient cannot be represented, the
behavior is undefined.
Syntax:
#include math
double fmod (double x, double y);
fopen
Opens a file by file pointer.
Syntax:
#include stdio
FILE *fopen(char *file_spec, char *mode
[,char *file_attribute,...]);
Modes are: "r" (read), "w" (write), "a" (append), "r+" (read
update), "w+" (write update), and "a+" (append update).
fprintf
Performs formatted output to a specified file.
Syntax:
#include stdio
int fprintf(FILE *pointer, char *format
[,output_source,...]);
A format specification is a character string that states the output
format. The string may contain ordinary characters which are
simply copied to the output, or it may contain a format
specification. Format specifications begin with a percent sign
(%), and end with a conversion character that states the output
format. Each format specification must be paired with an output
source. Format specifications are matched to output sources in
left-to-right order.
Additional information available:
Conversion Characters
d Convert to decimal format
o Convert to unsigned octal format
x Convert to unsigned hexadecimal format
u Convert to unsigned decimal format
c Output a single non-NUL character
s Output a string of characters
e Convert float or double to the format
[-]m.nnnnnnE[+|-]xx
f Convert float or double to the format [-]m.nnnnnn
g Convert float or double to the shortest format
of d, e, or f.
l Used with d, o, x, or u, specifies the corresponding
long integer.
% Write out the percent symbol
fputc
Write a character to a file.
Syntax:
#include stdio
int fputc(char character, FILE *file_pointer);
fputs
Writes a character string to a file.
Syntax:
#include stdio
int fputs(char *string, FILE *file_pointer);
fread
Reads a specified number of items from a file.
Syntax:
#include stdio
int fread(char *pointer, size_t length size_t nitems,
FILE (*file_pointer);
free
Deallocates the area allocated by calloc, malloc, or realloc.
Traditionally, free is used with malloc and cfree is used with
calloc. However, in VAX C, the free and cfree functions are the
same.
Syntax:
#include stdlib
int free(char *pointer);
freopen
Reassigns the address of a file pointer and opens the file. The
argument SPEC is a valid file specification.
Syntax:
#include stdio
FILE *freopen(char *spec, char *access_mode,FILE *file_pointer
[,char *file_attribute,...]);
frexp
Returns the mantissa of a double value. The mantissa is also
double and its magnitude is less than 1.
Syntax:
#include math
double frexp(double value,int eptr);
fscanf
Performs formatted input from a file.
Syntax:
#include stdio
fscanf(FILE *file_pointer, char *format, [,input_pointer...]);
Format specifications begin with a percent sign (%) followed by a
conversion character and a number indicating the size of the field.
Additional information available:
Conversion Characters
d Decimal integer
D Decimal long integer
o Octal integer
O Octal long integer
x Hexadecimal integer
X Hexadeciml long integer
hd, ho, hx Short integer of the specified radix
c Single character
s Character string
e,f Floating-point number having the form:
[+|-]nnn[.[ddd]][[E|e][+|-]nn]
E,F Double-precision e and f
ld, lo, lx Long decimal, long octal, and long hexadecimal integer
le, lf Double-precision e and f
[..] Brackets enclosing a set of characters. The set is
made up of the characters in the string field. If the
first character is an up-arrow (^), the set is made up
of the delimiters for the field.
fseek
Positions to a specified byte offset from either the beginning of
the file or from the current location within the file.
Syntax:
#include stdio
int fseek(FILE *file_pointer,int offset,int direction);
fsetpos
Sets the current file position.
Syntax:
#include stdio
int fsetpos (FILE *file_pointer, const fpos_t *fpos);
fstat
Accesses information about the file descriptor using a structure
containing information about that file.
The pointer buffer points to a structure, defined in the stat
definition module, which contains information about the file. This
function returns zero upon successful completion; otherwise it
returns -1.
Syntax:
#include unixio
#include stat
void fstat(int file_descriptor, stat_t *buffer);
ftell
Returns the byte offset from the beginning of the file to the
current location within the file.
Syntax:
#include stdio
int ftell(FILE *file_pointer);
ftime
Returns the time elasped on the system since 00:00:00 January 1,
1970.
Syntax:
#include time
void ftime(timeb_t *time_pointer);
The time_b structure contains the members time_t time, unsigned
short millitm, short timezone, and short dstflag.
fwrite
Appends the specified number of items to the file.
Syntax:
#include stdio
int fwrite(char *pointer, sizeof(*pointer), int nitems,
FILE *file_pointer);
gcvt
Converts a double value to a NUL-terminated string of ASCII digits
and returns the address of the string.
Syntax:
char *gcvt(double value, int ndigit, char *buf);
getc
Returns the next character from the file. getc is implemented as a
macro. fgetc generates a function call.
Syntax:
#include stdio
int getc(FILE *file_pointer);
[w]getch
Curses Screen management function and macro which get a character
from the terminal screen and echo it on the specified window.
Syntax:
#include curses
getch(void)
wgetch(WINDOW *win);
getchar
Returns the next character from the standard input device.
Syntax:
#include stdio
int getchar(void)
getcwd
Returns the current working directory.
Syntax:
#include stdlib
char *getcwd (char *buffer, unsigned int size,...);
getegid
Returns the group number from the user identification code.
Syntax:
unsigned getegid()
getenv
Searches the environment array and returns the value associated
with the environment name. The names can be one of the following:
HOME user's login directory
TERM terminal type
PATH default device and directory
USER name of the user initiating the process
Syntax:
char *getenv(char *name);
geteuid
Returns the member number from the user identification code.
Syntax:
unsigned geteuid(void)
getgid
Returns the group number from the user identification code.
Syntax:
#include stdlib
unsigned getgid(void)
getname
Returns the VAX/VMS file specification associated with the integer
file descriptor. The getname function is unique to VAX C.
Syntax:
#include unixio
char *getname(int file_descriptor,char *buffer);
getpid
Returns the current process ID.
Syntax:
int getpid(void)
getppid
Returns the parent process ID of the calling process.
Syntax:
int getppid (void);
gets
Reads a line from the standard input device. The newline
terminator is replaced with the ASCII NUL character.
Syntax:
#include stdio
char *gets(char *string);
[w]getstr
Curses Screen management function and macro which get a string from
the terminal screen, store it in a declared variable, and echo it
on the specified window.
Syntax:
#include curses
getstr(char *str)
wgetstr(WINDOW *win, char *str);
getuid
Returns the member number from the user identification code.
Syntax:
unsigned getuid(void)
getw
Returns the next four characters from the file as an integer.
Syntax:
#include stdio
int getw(FILE *file_pointer);
getyx
Curses Screen Management function which puts the current cursor
coordinates, within the specified window, in declared variables y
and x.
Syntax:
#include curses
getyx(WINDOW *win, int y, int x);
gmtime
Converts calendar time into a broken-down time relative to GMT
(Greenwich Mean Time). This functionality is not supported in VAX
C. The gmtime function always returns NULL.
Syntax:
#include time
struct tm *gmtime (const time_t *timer);
gsignal
Raises a specified software signal.
Syntax:
#include signal
int gsignal(int sig[,int code])
hypot
Returns sqrt(x*x + y*y).
Syntax:
#include math
double hypot(double x, double y);
[w]inch
Curses Screen management function (winch) and macro (inch) which
return the character from the current cursor position on the
terminal screen without altering the window.
Syntax:
#include curses
inch(void)
char winch(WINDOW *win);
initscr
Curses Screen Management function which initializes Curses, and
must be called before using any Curses functions.
Syntax:
#include curses
WINDOW *initscr(void)
[w]insch
Curses Screen management function (winsch) and macro (insch) which
insert the specified character at the current position of the
cursor in the specified window.
Syntax:
#include curses
insch(char ch)
int winsch(WINDOW *win, char ch);
[w]insertln
Curses Screen management function (winsertln) and macro (insertln)
which insert a line above the line containing the current cusor
position on the specified window; the bottom line of the window
scrolls off of the screen.
Syntax:
#include curses
insertln(void)
int winsertln(WINDOW *win);
[w]insstr
Curses Screen management function (winsstr) and macro (insstr)
which insert the defined string at the current cursor position on
the specified window; characters on the line scroll to the right.
Syntax:
#include curses
insstr(char *str)
int winsstr(WINDOW *win, char *str);
isalnum
Returns an nonzero integer if the character is alphanumeric.
Syntax:
#include ctype
int isalnum(char character);
isalpha
Returns a nonzero integer if the character is alphabetic.
Syntax:
#include ctype
int isalpha(char character);
isapipe
Returns 1 if the specified file descriptor is associated with a
mailbox, and zero if it is not.
Syntax:
#include stdio
int isapipe(int file_descriptor);
isascii
Returns a nonzero integer if the character is ASCII.
Syntax:
#include ctype
int isascii(char character);
isatty
Returns 1 if the file descriptor is associated with a terminal, 0
if it is not.
Syntax:
#include unixio
int isatty(int file_descriptor);
iscntrl
Returns a nonzero integer if the character is an ASCII DEL or
nonprinting character.
Syntax:
#include ctype
int iscntrl(char character);
isdigit
Returns a nonzero integer if the character is a digit.
Syntax:
#include ctype
int isdigit(char character);
isgraph
Returns a nonzero integer if the character is an ASCII graphic
character.
Syntax:
#include ctype
int isgraph(char character);
islower
Returns a nonzero integer if the character is lowercase.
Syntax:
#include ctype
int islower(char character);
isprint
Returns a nonzero integer if the character is an ASCII printing
character.
Syntax:
#include ctype
int isprint(char character);
ispunct
Returns a nonzero integer if the character is an ASCII punctuation
character.
Syntax:
#include ctype
int ispunct(char character);
isspace
Returns a nonzero integer if the character is an ASCII space,
horizontal or vertical tab, carriage return, form feed, or newline.
Syntax:
#include ctype
int isspace(char character);
isupper
Returns a nonzero integer if the character is uppercase.
Syntax:
#include ctype
int isupper(char character);
isxdigit
Returns a nonzero integer if the character is a hexadecimal digit.
Syntax:
#include ctype
int isxdigit(char character);
kill
Sends a signal to a process.
Syntax:
#include signal
int kill(int pid, int sig);
ldexp
Returns its first argument times 2 to the power of its second
argument.
Syntax:
#include math
double ldexp(double value,int e);
ldiv
Returns the quotient and remainder after the division of its
arguments.
Syntax:
#include stdlib
ldiv_t ldiv(long int numer, long int denom);
leaveok
Curses Screen Management macro which signals Curses to leave the
cursor at the current coordinates after the last update to the
window if boolf is true.
Syntax:
#include curses
leaveok(WINDOW *win, bool boolf);
localtime
Converts a time in seconds into hours, minutes, seconds, month,
day, day of the month, year, day of the week, and day of the year.
Syntax:
#include time
struct tm *localtime(int bintim);
log
Returns the natural (base-e) logarithm of its argument.
Syntax:
#include math
double log(double x);
log10
Returns the base-10 logarithm of its argument.
Syntax:
#include math
double log10(double x);
longjmp
Restores the register context of the environment buffer of its
associated setjmp call.
Syntax:
#include setjmp
void longjmp(jmp_buf env, int val);
longname
Curses function which assigns the full terminal name to a variable
which must be large enough to hold the string. The argument,
termbuf, is a dummy variable. If portability is a concern, you
must write a set of dummy routines to perform the functionality
provided by termcap in the UNIX* system environment.
Syntax:
#include curses
longname(char *termbuf, char *name);
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
lseek
Positions to a byte offset within a file and returns the new
position as an integer. The new position can be from either the
beginning of the file (direction = 0), the current position
(direction = 1), or the end-of-file (direction = 2).
Syntax:
#include unixio
int lseek(int file_descriptor, int offset, int direction);
malloc
Allocates an area of contiguous memory.
Syntax:
#include stdlib
void *malloc(unsigned size);
memchr
Locates the first occurence of a specified character within the
initial size characters in a given array and returns a pointer to
that character.
Syntax:
#include string
int memchr (const void *s1,int c, size_t size);
memcmp
Compares character strings in two arrays. The compare operation
starts with the first character in each array and returns an
integer less than, equal to, or greater than 0, depending on
whether the lexical value of the first array is less than, equal
to, or greater than that of the second array.
Syntax:
#include string
int memcmp (const void *s1, const void *s2, size_t size);
memcpy
Copies a specified number of characters from one array to another.
Syntax:
#include string
void *memcpy (void *s1, const void *s2, size_t size);
memset
Sets a specified number of bytes in a given array to the value of a
given character.
Syntax:
#include string
void *memset (void *s, char character, size_t size);
mkdir
Creates a new directory.
Syntax:
int mkdir(char *dir_spec, unsigned mode [,unsigned uic,
unsigned max_versions, unsigned r_v_num]);
The argument, dir_spec, is a valid VAX/VMS or DEC/Shell directory
specification which can include a device name. The argument, mode,
sets the file protection (see chmod in The Guide to VAX C); the
argument, uic, sets the User Identification Code; the argument,
r_v_num sets the relative volume number. This function returns
zero on success and -1 on failure.
mktemp
Creates a unique file name from a template which you supply. The
template has the form: "namXXXXXX". The X's are replaced by a
unique series of characters; "nam" is optional.
Syntax:
#include unixio
char *mktemp(char *template);
modf
Returns the positive fractional part of its first argument and
assigns the address of the integral part to its second argument.
Syntax:
#include math
double modf(double value, double iptr);
[w]move
Curses Screen Management function (wmove) and macro (move) which
change the current position of the cursor in the specified window
to the specified coordinates.
Syntax:
#include curses
move(int y, int x)
int wmove(WINDOW *win, int y, int x);
mv[w]addch
Curses Screen Management macros which move to the specified
coordinates on the specified window and add a single character to
the terminal screen.
Syntax:
#include curses
mvaddch(int y, int x, char ch)
mvwaddch(WINDOW *win, int y, int x, char ch);
mv[w]addstr
Curses Screen Management macros which move to the specified
coordinates on the specified window and add a string to the
terminal screen.
Syntax:
#include curses
mvaddstr(int y, int x, char *str)
mvwaddstr(WINDOW *win, int y, int x, char *str);
mvcur
Curses Screen Management macro which moves the cursor from the
current position of the cursor to the specified new position of the
cursor in an optimal fashion
Syntax:
#include curses
mvcur(int lasty, int lastx, int newy, int newx);
mv[w]delch
Curses Screen Management macros which move to the specified
coordinates on the specified window and delete a character.
Syntax:
#include curses
mvdelch(int y, int x, char ch)
mvwdelch(WINDOW *win, int y, int x, char ch);
mv[w]getch
Curses Screen Management macros which move to the specified
coordinates on the specified window, get a character from the
terminal screen, and echo it on the window.
Syntax:
#include curses
mvgetch(int y, int x, char ch)
mvwgetch(WINDOW *win, int y, int x, char ch);
mv[w]getstr
Curses Screen Management macros which move to the specified
coordinates on the specified window, get a string from the terminal
screen, and echo it on the window.
Syntax:
#include curses
mvgetstr(int y, int x, char *str)
mvwgetstr(WINDOW *win, int y, x, char *str);
mv[w]inch
Curses Screen Management macros which move to the specified
coordinates on the specified window and return the character
without making changes to the window.
Syntax:
#include curses
mvinch(int y, int x, char ch)
mvwinch(WINDOW *win, int y, int x, char ch);
mv[w]insch
Curses Screen Management macros which move to the specified
coordinates on the specified window and insert the specified
character.
Syntax:
#include curses
mvinsch(int y, int x, char ch)
mvwinsch(WINDOW *win, int y, int x, char ch);
mv[w]insstr
Curses Screen Management macros which move to the specified
coordinates on the specified window and insert a string.
Syntax:
#include curses
mvinsstr(int y, int x, char *str)
mvwinsstr(WINDOW *win, int y, int x, char str);
mvwin
Curses Screen Management routine which moves the starting position
-- the upper left corner -- of the specified window to the
specified coordinates.
Syntax:
#include curses
wvwin(WINDOW *win, int y, int x);
newwin
Curses Screen Management routine which creates a new window with a
specified number of lines and columns with the upper left corner of
the window being the specified starting position.
Syntax:
#include curses
WINDOW newwin(int numlines, int numcols, int start_y, int
start_x);
nice
Increases or decreases a process priority.
Syntax:
nice(int increment);
[no]nl
Curses Screen Management functions and macros which unset and set
the terminal to and from newline mode: i.e., start and stop the
system from mapping <RET> to <LINE-FEED>.
Syntax:
#include curses
nl(void)
nonl(void)
open
Opens a file for reading only (the O_RDONLY flag), writing only
(O_WRONLY), reading and writing (O_RDWR), appending upon writing
(O_APPEND), creating a new file (O_CREAT), creating a new version
of a file (O_TRUNC), and generating an error if attempting to
create an existing file (O_EXECL). You may specify modes which
sets the file protection status. These modes are defined in the
file.h definition module.
Syntax:
#include file
int open(char *name, int flag, int mode);
overlay
Curses Screen Management routine which nondestructively overlays
one specified window on another specified window; blanks on the
"top" window leave the contents of the "bottom" window unaltered.
Syntax:
#include curses
int overlay(WINDOW *win1, WINDOW *win2);
overwrite
Curses Screen Management routine which destructively overwrites one
specified window on another specified window; blanks on the "top"
window will be written on the "bottom" window as blanks.
Syntax:
#include curses
int overwrite(WINDOW *win1, WINDOW *win2);
pause
Stops the calling process until it receives a signal.
Syntax:
#include signal
int pause(void)
perror
Writes a short message to stderr describing the last error
encountered during a call to the operating system.
Syntax:
extern char *sys_errlist[];
extern int sys_nerr;
perror(char *string);
pipe
Allows two child processes to share data with read and write calls.
Syntax:
#include processes
int pipe(int file_descriptor[2]);
pow
Returns the first argument raised to the power of the second
argument.
Syntax:
#include math
double pow(double x,double y);
printf
Performs formatted output to the standard output device.
Syntax:
#include stdio
int printf(char *format_specification [,output_source,...]);
A format specification is a character string that states the output
format. The string may contain ordinary characters which are
simply copied to the output, or it may contain a format
specification. Format specifications begin with a percent sign
(%), and end with a conversion character that states the output
format. Each format specification must be paired with an output
source. Format specifications are matched to output sources in
left-to-right order.
Additional information available:
Conversion Characters
d Convert to decimal format
o Convert to unsigned octal format
x Convert to unsigned hexadecimal format
u Convert to unsigned decimal format
c Output a single non-NUL character
s Output a string of characters
e Convert float or double to the format
[-]m.nnnnnnE[+|-]xx
f Convert float or double to the format [-]m.nnnnnn
g Convert float or double to the shortest format
of d, e, or f.
l Used with d, o, x, or u, specifies the corresponding
long integer.
% Write out the percent symbol
[w]printw
Curses Screen Management function and macro which perform a PRINTF
on the specified window starting at the current cursor position on
the terminal screen. The format specification and the arguments
are identical to those of PRINTF.
Syntax:
#include curses
printw(char *format [, arg1, arg2, ...])
int wprintw(WINDOW *win, char *format [, arg1, arg2, ...]);
putc
Writes a character to a file.
Syntax:
#include stdio
int putc(char character, FILE *file_pointer);
putchar
Writes a character to the standard output device.
Syntax:
#include stdio
int putchar(char character);
puts
Writes a NUL-terminated string followed by a \n to the standard
output device.
Syntax:
#include stdio
int puts(char *string);
putw
Writes the next four character to a file as an integer.
Syntax:
#include stdio
int putw(int integer, FILE *file_pointer);
qsort
Performs a quicksort on an array of objects in place.
Syntax:
#include stdlib
void qsort (void base,
size_t nmemb,
size_t size,
int (*compar) const void *, const void *));
rand
Returns pseudorandom numbers in the range 0 to (2**31-1).
Syntax:
#include stdlib
int rand(void)
[no]raw
Curses Screen Management functions and macros which set and unset
the terminal to and from raw mode. The routine RAW performs the
same task as CRMODE except that it does not imply NONL. These
functions and macros are provided only for portability with
programs running on UNIX* systems.
Syntax:
#include curses
raw(void)
noraw(void)
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
read
Reads a specified numbers of bytes from a file and places them in a
buffer.
Syntax:
#include unixio
int read(int file_descriptor, char *buffer, int nbytes);
realloc
Changes the size of an area in memory by the number of bytes
specified.
Syntax:
#include stdlib
char *realloc(char *pointer, unsigned size);
[w]refresh
Curses Screen Management function (wrefresh) and macro (refresh)
which make all previous edits to the specified window visable on
the terminal screen.
Syntax:
#include curses
refresh(void)
int wrefresh(WINDOW *win);
remove
Deletes a closed file. This function is equivalent to the delete
function.
Syntax:
#include stdio
int remove (const char *file-spec);
rename
Gives a new name to an existing file.
Syntax:
#include stdio
int rename (const char *old_file_spec,
const char *new_file_spec);
rewind
Positions to the beginning of the file.
Syntax:
#include stdio
int rewind(FILE *file_pointer);
sbrk
Adds a (positive or negative) number of bytes to the current break
and returns the old break value.
Syntax:
char *sbrk(unsigned incr);
scanf
Performs formatted input from the standard input device.
Syntax:
#include stdio
int scanf(char *format [,input_pointer...]);
Format specifications begin with a percent sign (%) followed by a
conversion character and a number indicating the size of the field.
Additional information available:
Conversion Characters
d Decimal integer
D Decimal long integer
o Octal integer
O Octal long integer
x Hexadecimal integer
X Hexadeciml long integer
hd, ho, hx Short integer of the specified radix
c Single character
s Character string
e,f Floating-point number having the form:
[+|-]nnn[.[ddd]][[E|e][+|-]nn]
E,F Double-precision e and f
ld, lo, lx Long decimal, long octal, and long hexadecimal integer
le, lf Double-precision e and f
[..] Brackets enclosing a set of characters. The set is
made up of the characters in the string field. If the
first character is an up-arrow (^), the set is made up
of the delimiters for the field.
[w]scanw
Curses Screen Management function and macro which perform a SCANF
on the specified window starting at the current cursor position on
the terminal screen. The format specification and the arguments
are identical to those of SCANF. These functions and macros
accept, format, and return a line of text from the terminal screen.
Syntax:
#include curses
scanw(char *format [, arg1, arg2, ...])
int wscanw(WINDOW *win, char *format [, arg1, arg2, ...]);
scroll
Curses Screen Management routine which moves all of the lines in
the specified window up one line; the top line scrolls off the
window and the bottom line becomes blank.
Syntax:
#include curses
int scroll(WINDOW *win);
scrollok
Curses Screen Management macro which sets the scroll flag for the
specified window. If boolf is false, scrolling is not allowed;
this is the default setting.
Syntax:
#include curses
scrollok(WINDOW *win, bool boolf);
[w]setattr
Curses Screen Management function and macro which activate the
video display attributes boldface, blinking, reverse video, and
underlining within a specified window on the terminal screen. The
attributes are represented by _BOLD, _BLINK, _REVERSE, and
_UNDERLINE.
Syntax:
#include curses
setattr(unsigned attr)
wsetattr(WINDOW *win, unsigned attr);
setbuf
Associates a buffer with an input or output file.
Syntax:
#include stdio
void setbuf(FILE *file_pointer, char *buffer);
setgid
Included for compatability; no operation performed.
Syntax:
int setgid(unsigned group_number);
setjmp
Saves the register context of the calline function for a subsequent
longjmp call.
Syntax:
#include setjmp
setjmp(jmp_buf env);
setuid
Included for compatability; no operation performed.
Syntax:
int setuid(unsigned member_number);
setvbuf
Associate a buffer with an input or output file.
Syntax:
#include stdio
int setvbuf (FILE *file_ptr, char *buffer, int type,
size_t size);
sigblock
Causes the signals designated in a mask to be blocked from
delivery. The function returns the previous set of masking
signals.
Syntax:
#include signal
int sigblock(int mask);
signal
Allows you to either catch or ignore a signal.
Syntax:
#include signal
int (*signal(int sig,void (*func)(int,...)))(int,...);
sigpause
Causes the signals designated in a mask to be blocked from delivery
and then awaits a signal. The function restores the previous set
of masking signals and then returns EINTR, for "interrupt."
Syntax:
#include signal
int sigpause(int mask);
sigsetmask
Establishes the signals designated in a mask to be blocked from
delivery. The function returns the previous set of masking
signals.
Syntax:
#include signal
int sigsetmask(int mask);
sigstack
Defines an alternate stack on which signals are to be processed.
If successful, it returns zero; otherwise, it returns -1.
Syntax:
#include signal
int sigstack(struct sigstack *ss, struct sigstack *oss);
sigvec
Assigns a handler for a specific signal. It returns zero if
successful; otherwise, it returns -1.
Syntax:
#include signal
int sigvec(int sigint, struct sigvec *sv, struct sigvec *osv);
sin
Returns a double value that is the sine of its radian argument.
Syntax:
#include math
double sin(double x);
sinh
Returns the hyperbolic sine of its argument.
Syntax:
#include math
double sinh(double x);
sleep
Suspends the current process for at least the specified number of
seconds.
Syntax:
int sleep(unsigned seconds);
sprintf
Performs formatted output to a character string in memory.
Syntax:
#include stdio
int sprintf(char *string, char *format [,output_source,...]);
A format specification is a character string that states the output
format. The string may contain ordinary characters which are
simply copied to the output, or it may contain a format
specification. Format specifications begin with a percent sign
(%), and end with a conversion character that states the output
format. Each format specification must be paired with an output
source. Format specifications are matched to output sources in
left-to-right order.
Additional information available:
Conversion Characters
d Convert to decimal format
o Convert to unsigned octal format
x Convert to unsigned hexadecimal format
u Convert to unsigned decimal format
c Output a single non-NUL character
s Output a string of characters
e Convert float or double to the format
[-]m.nnnnnnE[+|-]xx
f Convert float or double to the format [-]m.nnnnnn
g Convert float or double to the shortest format
of d, e, or f.
l Used with d, o, x, or u, specifies the corresponding
long integer.
% Write out the percent symbol
sqrt
Returns the square root of its argument.
Syntax:
#include math
double sqrt(double x);
srand
Reinitializes the random number generator when the argument 1 is
used, or sets it to a specific point with any other number.
Syntax:
#include stdlib
int srand(int seed);
sscanf
Performs formatted input from a character string in memory.
Syntax:
#include stdio
sscanf(char *string, char *format [,input_pointer...]);
Format specifications begin with a percent sign (%) followed by a
conversion character and a number indicating the size of the field.
Additional information available:
Conversion Characters
d Decimal integer
D Decimal long integer
o Octal integer
O Octal long integer
x Hexadecimal integer
X Hexadeciml long integer
hd, ho, hx Short integer of the specified radix
c Single character
s Character string
e,f Floating-point number having the form:
[+|-]nnn[.[ddd]][[E|e][+|-]nn]
E,F Double-precision e and f
ld, lo, lx Long decimal, long octal, and long hexadecimal integer
le, lf Double-precision e and f
[..] Brackets enclosing a set of characters. The set is
made up of the characters in the string field. If the
first character is an up-arrow (^), the set is made up
of the delimiters for the field.
ssignal
Establishes the action to take when a specific signal is raised.
Syntax:
#include signal
void (*ssignal (int sig, void (*func) (int,...))) (int,...);
[w]standend
Curses Screen Management function (wstandend) and macro (standend)
which deactivate the boldface attribute of the specified window.
Syntax:
#include curses
standend(void)
int wstandend(WINDOW *win);
[w]standout
Curses Screen Management function (wstandout) and macro (standout)
which activate the boldface attribute of the specified window.
Syntax:
#include curses
standout(void)
int wstandout(WINDOW *win);
stat
Accesses information about the file path using a structure
containing information about that file. The path must be a valid
file specification.
The pointer buffer points to a structure, defined in the stat
definition module, which contains information about the file. This
function returns zero upon successful completion; otherwise it
returns -1.
Syntax:
#include unixio
#include stat
void stat(char *file_path, stat_t *buffer);
strcat
Concatenates strings. strcat terminates the concatenated string
with a NUL.
Syntax:
#include string
char *strcat(char *string_1, char *string_2);
strchr
strchr returns the address of the first occurrence of a given
character in a NUL-terminated string.
Syntax:
#include string
char *strchr(char *string, char character);
strcmp
strcmp compares two strings and indicates whether the first string
is lexicographically less than, equal to, or greater than the
second string.
Syntax:
#include string
int strcmp(char *string_1, char *string_2);
strcpy
strcpy copies string_2 to string_1, stopping after string_2's NUL
terminator is copied.
Syntax:
#include string
char *strcpy(char *string_1, char *string_2);
strcspn
Searches a string for the occurrence of a character in a set and
returns the number of characters that precede the matched
character.
Syntax:
#include string
int strcspn(char *string, char *charset);
strerror
Returns a C RTL error message string corresponding to a C RTL error
code.
Syntax:
#include string
char *strerror (int errnum);
strlen
Returns the length of an ASCII string, not including the NUL
terminator.
Syntax:
#include string
int strlen(char *string);
strncat
strncat concatenates the second string to the first up to a
specified maximum or until NUL is encountered.
Syntax:
#include string
char *strncat(char *string_1, char *string_2, int max);
strncmp
strncmp comparison up to a maximum number of characters in the two
strings and returns a value to indicate whether the first string is
less than, equal to, or greater than the second string.
Syntax:
#include string
int strncmp(char *string_1, char *string_2, int max);
strncpy
strncpy copies a specified number of characters from string_2 to
string_1 either truncating string_2 or padding it with NUL
characters.
Syntax:
#include string
char *strncpy(char *string_1, char *string_2, int max);
strpbrk
Searches a string for the occurrence of a character within a set
and returns the first character in the string that is in the set.
Syntax:
#include string
char *strpbrk(char *string, char *charset);
strrchr
Returns the address of the last occurrence of a given character in
a string.
Syntax:
#include string
char *strrchr(char *string, char character);
strtod
Converts a given string to a double-precision number.
Syntax:
#include stdlib
double strtod (const char *nptr, char **endptr);
strtok
Locates text tokens in a given string.
Syntax:
#include string
char *strstr (const char *s1, const char *s2);
strtol
Converts a string of ASCII characters to the appropriate numeric
values.
Syntax:
#include stdlib
long int strtol (const char *nptr, char **endptr, int base);
strtoul
Converts the initial portion of the string pointed to by nptr to an
unsigned long integer.
Syntax:
#include stdlib
unsigned long int strtoul (const char *nptr, char **endptr,
int base);
strspn
Searches a string for the first occurrence of a character that is
not in a set of characters and returns the number of characters
that preceded the mismatched character.
Syntax:
#include string
char *strspn(const char *string, const char *charset);
subwin
Curses Screen Management routine which creates a subwindow with the
specified number of lines and columns, at the starting point
coordinate -- upper left corner. The entire subwindow must be
contained within the borders of the specified window. Any changes
made to either window within the coordinates of the subwindow will
be made to both windows.
Syntax:
#include curses
WINDOW subwin(WINDOW *win, int numlines, int numcols, int
start_y, int start_x);
system
Passes a given string to the host environment to be executed by a
command processor.
Syntax:
#include processes
int system (const char *string);
tan
Returns the tangent of its radian argument.
Syntax:
#include math
double tan(double x);
tanh
Returns the hyperbolic tangent of its argument.
Syntax:
#include math
double tanh(double x);
time
Returns the time elasped on the system since 00:00:00 January 1,
1970.
Syntax:
#include time
time_t time(long *time_location);
times
Returns the accumulated times of the current process and of its
terminated child processes to a buffer.
Syntax:
#include time
void times (tbuffer_t *buffer);
tmpfile
Creates a temporary file.
Syntax:
#include stdio
FILE *tmpfile(void)
tmpnam
Creates a character string that can be used in place of the file
name argument in other function calls.
Syntax:
#include stdio
char *tmpnam(char *name);
toascii
Converts an 8-bit ASCII character to a 7-bit ASCII character.
Syntax:
#include ctype
int toascii(char character);
tolower
Converts an uppercase letter to lowercase; returns lowercase
letters unchanged. tolower is a true function; _tolower is a
macro.
Syntax:
#include ctype /* If using _tolower */
char tolower(char character);
char _tolower(char character);
touchwin
Curses Screen Management routine which places the portion of the
specified window, which was overlapped -- occluded -- by another
window, onto the terminal screen for viewing.
Syntax:
#include curses
int touchwin(WINDOW *win);
toupper
Converts lowercase letters to uppercase, returns uppercase letters
unchanged. toupper is a true function; _toupper is a macro.
Syntax:
#include ctype /* if using _toupper */
char toupper(char character);
char _toupper(char character);
ttyname
Returns a pointer to the null-terminated path name of the terminal
device associated with the operating system file descriptor. This
function is provided only for UNIX* system compatibility.
Syntax:
#include unixio
int *ttyname(int descriptor)
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
umask
Creates a file protection mask.
Syntax:
int umask(unsigned mode_complement);
ungetc
Writes a character to the buffer and leaves the file positioned
before the character.
Syntax:
#include stdio
int ungetc(char character, FILE *file_pointer);
va arg
Returns the next item in a variable length argument list.
Syntax:
#include stdarg or #include varargs
type va_arg(va_list list_incrementor, int item_type);
va count
Returns the number of longwords in a variable length argument list.
Syntax:
#include stdarg or #include varargs
va_count(int count);
va end
Ends the the session of accessing variable argument lists.
Syntax:
#include stdarg or #include varargs
va_end(va_list list_incrementor);
va start
Initializes a pointer to the beginning of a variable length
argument list.
Syntax:
#include stdarg or #include varargs
int* va_start(va_list list_incrementor);
va start 1
Initializes a pointer to the beginning of a variable length
argument list when there are arguments preceding the variable
length argument list.
Syntax:
#include stdarg or #include varargs
int* va_start_1(va_list list_incrementor, int offset);
VAXC$ESTABLISH
Establishes a special VAX C RTL exception handler that catches all
RTL related exceptions and passes on all others to your handler.
Syntax:
#include signal
void VAXC$ESTABLISH(int exception_handler (void*,void*))();
vfork
Sets up the communication channels for spawning and controlling a
new (child) process.
Syntax:
#include processes
int vfork(void)
vprintf, vfprintf, vsprintf
Print formatted output based on an argument list. These functions
are the same as the *printf functions except that instead of being
called with a variable number of arguments, they are called with an
argument list that has been initialized by the macro va_start.
Syntax:
#include stdio
#include stdarg
int vprintf (const char *format, va_list *arg);
int vfprintf (FILE *file_ptr, const char *format,
va_list *arg);
int vsprintf (char *str, const *format, va_list *arg);
wait
Suspends the calling process until either a signal is received or
until a child process terminates.
Syntax:
#include processes
int wait(int *status);
wrapok
Curses macro which, in the UNIX* system environment, allows the
wrapping of a word from the right border of the window to the
beginning of the next line. This macro is provided only for UNIX
compatibility.
Syntax:
#include curses
wrapok(WINDOW *win, bool boolf);
----------
* UNIX is a registered trademark of American Telephone and Telegraph
Company.
write
Writes a number of bytes to a file.
Syntax:
#include unixio
int write(int file_descriptor,char *buffer,int nbytes);
Additional information available:
/*/*/*/*/*/*/*
/*/*/*/*/*/*/*
/*/*/*/*/*/*/*
/*/*/*/*/*/**/*
/*/*/*/*/*/*/*
/*/*/*/**/**/*/*
/*/*/*/*/*/*/*
/*/*/*/*/*/*/*
/*/*/*/*/*/*/*
/*
/*
*
* this module is the IVP child. after sending back its arguments
* via a pipe, it waits around to be murdered by the parent
* process (VAXCIVPP).
*
*/
#define outpipe 12
globalvalue ss$_normal;
main(argc, argv)
char **argv;
{
char *bufptr, *malloc(), *getenv();
int len, status;
while (argc--) {
len = strlen(*argv);
if (write (outpipe, *argv++, len) != len)
printf ("\nERROR in IVP child arg #%d\n", argc);
}
if ((bufptr = malloc(512)) == 0) printf("\nERROR in IVP child malloc\n");
if ((bufptr = getenv("USER")) == 0) printf("\nERROR in IVP child getenv\n");
if (strcmp(bufptr, cuserid(0)) != 0) printf("\nERROR in IVP child userid\n");
/*
* wait forever until killed by parent
*/
if ((status = pause()) == -1)
abort();
}
/*
*****************************************************************************
* *
* Copyright (c) 1978,1979,1980,1981,1982,1983,1984,1985,1986 *
* by DIGITAL Equipment Corporation, Maynard, Mass. *
* *
*****************************************************************************
facility: vax C Installation utility
*/
#include limits
#include float
#include ctype
#include errno
#include perror
#include math
#include signal
#include stdio
#include types /* note that types must come before timeb */
#include timeb
#include time
#include accdef
#include chfdef
#include dcdef
#include descrip
#include dvidef
#include errnodef
#include iodef
#include jpidef
#include msgdef
#include opcdef
#include pqldef
#include prvdef
#include psldef
#include rms
#include secdef
#include setjmp
#include sfdef
#include ssdef
#include stsdef
#include ttdef
#define fail 0
#define success 1
#define err 2
char *brk(), *sbrk(), *calloc(), *ctime(), *ecvt(), *fcvt(), *gcvt();
char *gets(), *fgets(), *malloc(), *realloc(), *strcat(), *strncat();
char *strchr(), *strrchr(), *strcpy(), *strncpy(), *strpbrk(), *tmpnam();
struct tm *localtime();
FILE *tmpfile();
main()
{
putchar ('\n');
if (icpmath() &&
icpio() &&
icpctyp() &&
icpcnv() &&
icpstr() &&
icperrs() &&
icpbrk() &&
icptim() &&
icpjmp() &&
icpsig() &&
icpfork() &&
icpunix1() &&
icpunix2() &&
icppreproc() )
{
puts ("\n****** VAX C Installation Certification Procedure SUCCESSFUL ******\n");
exit (SS$_NORMAL);
}
else
{
puts ("\n****** VAX C Installation Procedure FAILED ******\n");
exit (err);
}
}
#define TRUE 1
icppreproc()
{
#pragma member_alignment
int nxtst,limits_found,float_found;
#pragma nomember_alignment
nxtst = 0;
float_found = 0;
limits_found = 0;
#if defined( FLT_RADIX)
float_found = TRUE;
#elif defined( TRUE)
float_found = 0;
#endif
#if defined( UINT_MAX)
limits_found = TRUE;
#elif defined( TRUE)
limits_found = 0;
#endif
return limits_found && float_found ;
}
#define NOT_EQ_FUZZ(a,b) (fabs((a)-(b)) > 1e-6)
icpmath()
{
int nxtst, i;
double flt1,flt2;
double mth$dlog(),mth$dlog10(),mth$dexp(),mth$dsin(),mth$dcos(),
mth$dtan(),mth$dasin(),mth$dacos(),mth$datan(),
mth$dsinh(),mth$dcosh(),mth$dtanh(),mth$dsqrt(),
mth$datan2() ;
int i1,i2;
nxtst = 0;
/* abs */
nxtst++;
i1 = -32767;
if (abs(i1) != 32767) goto error;
/* ceil */
nxtst++;
flt1 = -99.1;
if (NOT_EQ_FUZZ(ceil(flt1),-99.0)) goto error;
/* exp */
nxtst++;
flt1 = 2E0;
if (NOT_EQ_FUZZ(exp(flt1),mth$dexp(&flt1))) goto error;
/* floor */
nxtst++;
flt1 = 15E0;
if (NOT_EQ_FUZZ(floor(flt1),flt1)) goto error;
/* log */
nxtst++;
flt1 = 225.5E0;
if (NOT_EQ_FUZZ(log(flt1),mth$dlog(&flt1))) goto error;
/* log10 */
nxtst++;
flt1 = 100E0;
if (NOT_EQ_FUZZ(log10(flt1),2E0)) goto error;
/* sqrt */
nxtst++;
flt1 = 10000E0;
if (NOT_EQ_FUZZ(sqrt(flt1),mth$dsqrt(&flt1))) goto error;
/* acos */
nxtst++;
flt1 = -.5E0;
if (NOT_EQ_FUZZ(acos(flt1),mth$dacos(&flt1))) goto error;
/* asin */
nxtst++;
flt1 = 0e0;
if (NOT_EQ_FUZZ(asin(0E0),mth$dasin(&flt1))) goto error;
/* atan */
nxtst++;
flt1 = 2.00000000E0;
if (NOT_EQ_FUZZ(atan(flt1),mth$datan(&flt1))) goto error;
/* atan2 */
nxtst++;
flt1 = -1.57E0;
flt2 = 0E0;
if (NOT_EQ_FUZZ(atan2(-1.5700000000E0,00000000E0),mth$datan2(&flt1,&flt2)))
goto error;
/* cos */
nxtst++;
flt1 = .7853900000E0;
if (NOT_EQ_FUZZ(cos(flt1),mth$dcos(&flt1))) goto error;
/* cosh */
nxtst++;
flt1 = 1.5707800000;
if (NOT_EQ_FUZZ(cosh(flt1),mth$dcosh(&flt1))) goto error;
/* sin */
nxtst++;
flt1 = 0E0;
if (NOT_EQ_FUZZ(sin(flt1),mth$dsin(&flt1))) goto error;
/* sinh */
nxtst++;
flt1 = .78539E0;
if (NOT_EQ_FUZZ(sinh(flt1),mth$dsinh(&flt1))) goto error;
/* tan */
nxtst++;
flt1 = 3.14159E0;
if (NOT_EQ_FUZZ(tan(flt1),mth$dtan(&flt1))) goto error;
/* tanh */
nxtst++;
flt1 = 0E0;
if (NOT_EQ_FUZZ(tanh(flt1),mth$dtanh(&flt1))) goto error;
/* fabs */
nxtst++;
flt1 = 45678;
if (NOT_EQ_FUZZ(fabs(flt1),flt1)) goto error;
/* frexp & ldexp */
nxtst++;
flt1 = 324.5E0;
flt2 = frexp(flt1, &i);
if (fabs(ldexp(flt2,i) - flt1) > .00001E0) goto error;
/* modf */
nxtst++;
flt1 = -23.45;
flt2 = modf(flt1,&flt1);
if (NOT_EQ_FUZZ(flt1,-23E0)) goto error;
if (fabs(flt2 + .45E0) > .001E0) goto error;
/* hypot */
nxtst++;
if (NOT_EQ_FUZZ(hypot(3E0,4E0),5E0)) goto error;
/* pow */
nxtst++;
if (fabs(pow (2.00000E0, 3.00000E0) - 8.00000E0) > .00001) goto error;
/* rand, srand */
nxtst++;
rand();
srand (5);
return (success);
/** error **/
error:
printf ("\nERROR from math test #%d\n",nxtst);
return (fail);
}
icpio()
{
int nxtst, i, j;
long longoff;
double d1, d2;
FILE *fp;
char filnam [132];
char *lptr, *lptr2;
char buf [512];
typedef struct person {
char first [15];
char last [20];
char nl; } rec6;
static rec6 items6 [15] = {
"Catherine ","Pacy ",'\n',
"Genghis ","Khan ",'\n',
"Marcus ","Cicero ",'\n',
"Ieyasu ","Tokugawa ",'\n',
"Miyamoto ","Musashi ",'\n',
"Savinien ","de Bergerac ",'\n',
"Siddharta ","Gautama ",'\n',
"Lancelot ","du Lac ",'\n',
"Leonardo ","da Vinci ",'\n',
"Sojourner ","Truth ",'\n',
"Lorenzo ","de Medici ",'\n',
"Boadicea ","of the Britons ",'\n',
"Alexander ","the Great ",'\n',
"Carlus ","Magnus ",'\n',
"Omar ","Khayyam ",'\n'
} ;
rec6 *recptr;
rec6 initems6 [15];
static char line1 [] = "In Xanadu did Kublai Khan / A stately pleasure dome decree,\n" ;
static char line2 [] = "Where Alph the sacred river ran / Down to the sunless sea.";
static char line3 [] = "Twas brilling, and the slithy toves/ Did gyre and gimble in the wabe.\n" ;
static char line4 [] = "All mimsy were the borogroves/ And the momey raths outgrabe.\n";
nxtst = 0;
/* check for initialization of FILE blocks */
if (fileno (stdin) != 0) goto error;
if (fileno (stdout) != 1) goto error;
if (fileno (stderr) != 2) goto error;
/* assign stdout to a file, and use the stdout functions (putchar & puts) */
nxtst++;
if (freopen ("icptmp1.tmp", "w ", stdout) == NULL) goto error;
for (i = 0; (j = putchar (line1 [i])) > 0; i++);
if (j) goto error;
if (puts (&line2) == EOF) goto error;
/* restore stdout to sys$output, open file for append and do file output */
nxtst++;
if (freopen ("SYS$OUTPUT", "w ", stdout) == NULL) goto error;
if ((fp = fopen ("icptmp1.tmp", "a+")) == NULL) goto error;
if ((longoff = ftell (fp)) == EOF) goto error; /* save where we begin */
if (fgetname (fp, &filnam) == NULL) goto error;
for (lptr = &line3; (j = putc (*lptr++, fp)) > 0;);
if (j) goto error;
for (i = 0; (j = fputc (line4 [i], fp)) > 0; i++);
if (j) goto error;
if (fputs("This is line #5, output by fputs\n", fp) == EOF) goto error;
if (fwrite (&items6, sizeof(rec6), 15, fp) != 15) goto error;
if (fflush (fp) == EOF) goto error;
/*
if (fp -> _cnt != 512) goto error; */
/* reset to where we began appending and do reads */
nxtst++;
if (fseek (fp, longoff, 0) == EOF) goto error;
j = getc (fp);
ungetc (j, fp);
i = getc (fp);
if (i != j) goto error;
ungetc (i,fp);
for (lptr = &line3; (j = getc (fp)) > 0; )
if (j != *lptr++) goto error;
for (i = 0; (j = fgetc (fp)) > 0; i++)
if (j != line4 [i]) goto error;
if ((int)fgets (&buf, 512, fp) == EOF) goto error;
if (strcmp (&buf, "This is line #5, output by fputs\n") != 0)
goto error;
recptr = &initems6;
if (fread (recptr, sizeof (*recptr), 15, fp) != 15) goto error;
for (i = 0; i < 15; i++) {
if (strcmp (&items6[i].first, &initems6[i].first) != 0)
goto error;
if (strcmp (&items6[i].last, &initems6[i].last) != 0)
goto error;
}
fclose (fp);
/* reopen this file as stdin and read from the beginning */
nxtst++;
if (freopen (&filnam, "r ", stdin) == NULL) goto error;
for (i = 0; (j = getchar()) > 0; i++)
if (j != line1[i]) goto error;
if ((int)gets (&buf) == EOF) goto error;
if (strcmp (&buf, &line2) != 0) goto error;
if (freopen ("SYS$INPUT", "r ", stdin) == NULL) goto error;
if (delete (&filnam) == -1) goto error;
/* open a new file and do integer putw and getw */
nxtst++;
if ((i = creat ("icptmp2.tmp", 0)) == EOF) goto error;
if ((fp = fdopen (i, "w+")) == NULL) goto error;
if (fgetname (fp, &filnam) == NULL) goto error;
for (i = 10; putw (i, fp); i--)
if (ferror(fp)) goto error;
rewind (fp);
for (i = 10; ferror(fp) == 0 && (j = getw (fp)); i--)
if (j != i) goto error;
if (ferror(fp)) goto error;
i = getc (fp);
if (feof(fp) == 0) goto error;
clearerr (fp);
if (feof(fp) != 0) goto error;
fclose (fp);
if (delete (&filnam) == -1) goto error;
/* temporary file stuff, setbuf */
nxtst++;
if ((fp = tmpfile()) == NULL) goto error;
if ((lptr = malloc (BUFSIZ)) == NULL) goto error;
setbuf (fp,lptr);
if ((*fp) -> _base != lptr) goto error;
for (i=0; putc (line1[i++],fp););
if (strcmp (lptr, &line1) != 0) goto error;
fclose (fp);
free (lptr);
/* tmpnam */
nxtst++;
if ((lptr = tmpnam(NULL)) == NULL) goto error;
if ((fp = fopen (lptr, "w+")) == NULL) goto error;
if (fgetname (fp, &filnam) == NULL) goto error;
/* printf and scanf */
nxtst++;
d1=4.000E20;
fprintf (fp,"%x %s %g \n",lptr,"Temujin",d1);
rewind(fp);
if (fscanf (fp, "%x %s %le ", &lptr2, &buf, &d2) != 3) goto error;
if (lptr2 != lptr) goto error;
if (strcmp(&buf, "Temujin") != 0) goto error;
if (d1 != d2) goto error;
fclose (fp);
delete (&filnam);
sprintf (&buf, "char=%c, octal=%o, g=%g\0", 'q', 56, 987E-4);
j=0;
if (sscanf (&buf,"char=%c, octal=%o, g=%le", &j, &i, &d1) != 3)
goto error;
if ((char)j != 'q') goto error;
if (i != 56) goto error;
if (d1 != 987E-4) goto error;
/* undefine putchar and getchar and do the functions */
#undef putchar
#undef getchar
nxtst++;
if (freopen("icptmp4.tmp","w ",stdout) == NULL) goto error;
if (putchar ('z') == EOF) goto error;
for (lptr = "543"; putchar (*lptr++););
if (freopen("SYS$OUTPUT","w ",stdout) == NULL) goto error;
if (freopen("icptmp4.tmp","r",stdin) == NULL) goto error;
if (getchar() != 'z') goto error;
if (scanf(" %d", &i) != 1) goto error;
if (i != 543) goto error;
if (freopen("SYS$INPUT","r",stdin) == NULL) goto error;
delete ("icptmp4.tmp");
return (success);
/** error **/
error:
freopen ("SYS$OUTPUT", "w ",stdout);
freopen ("SYS$INPUT", "r ",stdin);
printf ("\nERROR in I/O test #%d\n",nxtst);
return (fail);
}
#include stdio /* restore getchar and putchar */
icpctyp()
{
int i;
char c;
#define upper 0x1 /* Uppercase letters */
#define lower 0x2 /* Lowercase letters */
#define digit 0x4 /* Decimal digits */
#define space 0x8 /* White space */
#define punct 0x10 /* Punctuation marks */
#define cntrl 0x20 /* Control characters */
#define blank 0x40 /* Blank character */
static char ourctype [128] = {
cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,space|cntrl,space|cntrl,space|cntrl,space|cntrl,space|cntrl,cntrl,cntrl,
cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,cntrl,
blank|space,punct,punct,punct,punct,punct,punct,punct,punct,punct,punct,punct,punct,punct,punct,punct,
digit,digit,digit,digit,digit,digit,digit,digit,digit,digit,punct,punct,punct,punct,punct,punct,
punct,upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,
upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,upper,punct,punct,punct,punct,punct,
punct,lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,
lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,lower,punct,punct,punct,punct,cntrl};
/** test ctype initialization and ctype.h macros */
for (c = 0; c <= 127 && c >= 0; c++) {
i=0;
if ((isalnum(c) == 0) != ((ourctype [c] & (upper | lower |
digit )) == 0)) goto error;
i++;
if ((isalpha(c) == 0) != ((ourctype [c] & (upper | lower)) == 0)) goto error;
i++;
if (isascii (c) == 0) goto error;
i++;
if ((iscntrl (c) == 0) != ((ourctype [c] & cntrl) == 0)) goto error;
i++;
if ((isdigit (c) == 0) != ((ourctype [c] & digit) == 0)) goto error;
i++;
if ((isgraph (c) == 0) != ((ourctype [c] & (upper | lower |
digit | punct)) == 0)) goto error;
i++;
if ((islower (c) == 0) != ((ourctype [c] & lower) == 0)) goto error;
i++;
if ((isprint (c) == 0) != ((ourctype [c] & (upper | lower |
digit | punct | blank)) == 0)) goto error;
i++;
if ((ispunct (c) == 0) != ((ourctype [c] & punct) == 0)) goto error;
i++;
if ((isspace (c) == 0) != ((ourctype [c] & space) == 0)) goto error;
i++;
if ((isupper (c) == 0) != ((ourctype [c] & upper) == 0)) goto error;
i++;
}
return (success);
error:
printf ("\nERROR in ctype test #%d\n",i);
return (fail);
}
icpcnv()
{
double atof();
double dflt;
char *bufptr;
char buf [132];
int nxtst, i, j;
nxtst=0;
/* case conversions */
nxtst++;
if (tolower('A') != 'a') goto error;
if (tolower('[') != '[') goto error;
if (_tolower('B') != 'b') goto error;
if (toupper('a') != 'A') goto error;
if (toupper('~') != '~') goto error;
if (_toupper('a') != 'A') goto error;
/* ascii to float */
nxtst++;
if (atof ("-1.23E+02") != -1.23E+02) goto error;
/* ascii to int and long */
nxtst++;
if (atoi("523") != 523) goto error;
if (atol("-1024") != -1024) goto error;
/* ecvt */
nxtst++;
dflt = -325.E3;
bufptr = ecvt (dflt, 8, &i, &j);
if (strcmp (bufptr, "32500000") != 0) goto error;
if (i != 6) goto error;
if (j = 0) goto error;
/* gcvt */
nxtst++;
bufptr = gcvt (-128E0,5,buf);
if (strcmp (bufptr, "-128") != 0) goto error;
return (success);
error:
printf ("\nERROR in conversion test %d\n",nxtst);
return (fail);
}
icpstr()
{
char str0 [132];
static char *str1 = {"ALPHABET: "};
static char *str2 = {"abcdefghijklmnopqrstuvwxyz "};
static char *str3 = {"ALPHABET: abcdefghijklmnopqrstuvwxyz abc"};
static char *str4 = {"0123456789"};
char str5[2] ={'\x008', '\0'};
char str6[2] ={'\010','\0'};
char *sptr, *p;
int nxtst;
nxtst = 0;
/* concatenate */
nxtst++;
str0 [0] = '\0';
sptr = strcat(&str0, str1);
sptr = strcat(&str0, str2);
sptr = strncat(&str0, str2, 3);
for (p = str3; *p;)
if (*sptr++ != *p++) goto error;
/* strchr, strrchr */
nxtst++;
if (strchr (&str0,'a') != &str0[10]) goto error;
if (strrchr (&str0,'a') != &str0[37]) goto error;
/* strcmp, strncmp */
nxtst++;
if (strcmp (&str0, str3) != 0) goto error;
if (strcmp (&str0, str2) >= 0) goto error;
if (strncmp (str2, "abcxyz", 3) != 0) goto error;
if (strcmp(str5,str6) != 0) goto error;
/* strcpy, strncpy */
nxtst++;
sptr = strcpy(&str0, str4);
if (strcmp (sptr, str4) != 0) goto error;
sptr = calloc(20,1);
if (strcmp (strncpy (sptr, "0123456789abcdef",13), "0123456789abc")
!= 0) goto error;
/* strcspn, strspn */
nxtst++;
if (strcspn ("abc123xyz", str4) != 3) goto error;
if (strspn (sptr, str4) != 10) goto error;
/* strlen */
nxtst++;
if (strlen (&str0) != 10) goto error;
/* strpbrk */
nxtst++;
if (strpbrk (&str0, "345") != &str0[3]) goto error;
cfree(sptr);
return (success);
error:
printf ("\nERROR in string function test %d\n",nxtst);
return (fail);
}
icperrs()
{
double dflt;
char buf [132];
static char msg [132] = "ICPERR";
FILE *fp = 0;
char filnam [132];
if (freopen ("icperr.tmp", "w", stderr) == NULL) goto error;
clearerr (stderr);
dflt = log(-1E0);
if (errno != EDOM) goto error;
perror (&msg);
if (freopen ("SYS$ERROR", "w", stderr) == NULL) goto error;
if ((fp = fopen ("icperr.tmp", "r")) == NULL) goto error;
if (fgets (&buf, 132, fp) == NULL) goto error;
strcat (&msg, ": ");
strcat (&msg, sys_errlist[EDOM]);
strcat (&msg, "\n");
if (strcmp (&buf, &msg) != 0) goto error;
if (fgetname (fp, &filnam) == NULL) goto error;
fclose(fp);
if (delete (&filnam) == -1) goto error;
return (success);
error:
if (fp) fclose(fp);
freopen ("SYS$ERROR", "w ",stderr);
printf ("\nERROR in error test\n");
return (fail);
}
int killflag, alarmflag, quitflag, pid;
icpsig()
{
int catchalarm(), catchquit();
int nxtst, t1, i;
FILE *fp;
struct timeb tb;
nxtst = 0;
pid = getpid();
nxtst++;
if ((int)signal (SIGALRM, catchalarm) == -1)
{
nxtst += 100;
goto error;
}
alarmflag = 0;
t1 = time(0);
alarm (5);
pause ();
ftime (&tb);
if (tb.time - t1 <= 0)
{
nxtst += 200;
goto error;
}
if (alarmflag != 1)
{
nxtst += 300;
goto error;
}
nxtst++;
signal (SIGQUIT, catchquit);
if (ssignal (SIGQUIT, catchquit) == 0) goto error;
nxtst++;
quitflag = 0;
if (gsignal (SIGQUIT) != 1) goto error;
nxtst++;
if (quitflag != 1) goto error;
signal (SIGALRM, SIG_DFL);
signal (SIGQUIT, SIG_DFL);
return (success);
error:
printf ("\nERROR in signal test #%d\n", nxtst);
return (fail);
}
catchalarm()
{
SYS$WAKE (&pid);
alarmflag = 1;
return (1);
}
catchquit()
{
quitflag = 1;
return (1);
}
/*
* this module tests the execv, vfork, pipe, kill (and pause) functions
*
*
*/
#define inpipe 11
#define outpipe 12
#define wait_time 5 * 60
int vfork_flag;
icpfork()
{
/*
* definition of local variables
*/
static char *gargv[] = { "ARGC\n", "ARGC1\n", "icpcc\n", 0 };
int status, cstatus, fd[2], len, nxtst, i, icp_vfork_alarm();
char *bufptr;
static struct time_buffer
{
long process_user_time;
long process_system_time;
long child_user_time;
long child_system_time;
} timbuf = {0, 0, 0, 0};
/*
* now perform setup to create the child process
*/
errno = 0;
nxtst = 0;
if (pipe(fd) == -1) goto error;
nxtst++;
if (dup2(fd[0], inpipe) == -1) goto error;
nxtst++;
if (dup2(fd[1], outpipe) == -1) goto error;
nxtst++;
if (access("vaxcivpc.exe", 0) == -1) goto error;
nxtst++;
if ((status = vfork()) != 0) {
/*
* read the pipe and compare the arguments
*/
nxtst++;
if ((int)signal(SIGALRM, icp_vfork_alarm) == -1) goto error;
vfork_flag = 0;
alarm(wait_time);
nxtst++;
if ((bufptr = calloc(512,1)) == NULL) goto error;
for (i=0; i<3; i++) {
nxtst++;
if ((len = read(inpipe, bufptr, 512)) == -1) goto error;
if (strcmp (bufptr, gargv[i]) != 0) goto error;
}
vfork_flag = 1;
alarm(0);
/*
* now kill the child process
*/
nxtst++;
if (kill(status, SIGKILL) == -1) goto error;
/*
* wait for child process to finish and get information from it
*/
nxtst++;
if (wait(&cstatus) == -1) goto error;
nxtst++;
if (cstatus != SS$_ABORT) goto error;
nxtst++;
times (&timbuf);
if (timbuf.child_user_time == 0) goto error;
signal(SIGALRM, SIG_DFL);
return (success);
}
/*
* vfork was successful, so create the child process
*/
else {
nxtst++;
execv("VAXCIVPC", gargv);
goto error;
}
error:
printf ("\nERROR in vfork/exec test #%d\n", nxtst);
return (fail);
}
icp_vfork_alarm(sig)
{
if (vfork_flag == 0) {
printf ("\nERROR waiting for child to execute - process pipe read time-out\n");
puts ("\n****** VAX C Installation Procedure FAILED ******\n");
exit(err);
}
else
return(success);
}
/*
* this routine tests the following functions:
*
* brk - allocate memory routine to break
* sbrk - allocate specified number of bytes
*
*/
icpbrk()
{
char *begbrk, *endbrk, *start;
start = begbrk = sbrk(0);
if ((endbrk = brk(begbrk + 511)) != begbrk + 512) goto error;
if ((begbrk = sbrk(4)) != endbrk) goto error;
if ((begbrk = sbrk(-1025)) != start) goto error;
return(success);
error:
printf("\nERROR testing brk or sbrk function\n");
return(fail);
}
/*
*
* This routine tests the time functions ctime() and localtime()
*
* ctime(): returns 26 character string
* localtime(): returns pointer to a structure
* containing broken down time
*
*
*/
icptim()
{
char *strptr, date[26];
struct tm *ptr;
int t, nxtst;
static char *nmonth[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
static char *wkday[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
nxtst = 0;
t = time(0);
if ((strptr = ctime(&t)) == NULL) goto error;
nxtst++;
if ((ptr = localtime(&t)) == NULL) goto error;
nxtst++;
if (sprintf(date, "%s %s %2d %02d:%02d:%02d %d\n",
wkday[ptr->tm_wday],
nmonth[ptr->tm_mon],
ptr->tm_mday,
ptr->tm_hour,
ptr->tm_min,
ptr->tm_sec,
(ptr->tm_year+1900)) != 25) goto error;
nxtst++;
if (strcmp(strptr, date) != 0) goto error;
nxtst++;
return(success);
error:
printf("\nError in time test #%d\n", nxtst);
return(fail);
}
/*
*
*
* This routine tests the functions setjmp and longjmp.
*
* setjmp: saves state of calling procedure
* longjmp: restores state of program
*
*
*
*/
#define NORMAL 0
jmp_buf savenv;
icpjmp()
{
int nxtst = 0;
switch (setjmp(savenv))
{
case NORMAL:
level1(&nxtst);
nxtst++;
goto error;
break;
case success:
if (nxtst != 3) goto error;
return(success);
break;
}
error:
printf("\nError in setjmp/longjump test #%d\n", nxtst);
return(fail);
}
level1(n)
int *n;
{
(*n)++;
level2(n);
return;
}
level2(n)
int *n;
{
(*n)++;
level3(n);
return;
}
level3(n)
int *n;
{
(*n)++;
longjmp(savenv, success);
return;
}
#define PROCESS 2
struct JPI_ITEM_LIST {
short length1;
short type1;
short *grpid;
short *act_length1; /* group uic number */
short length2;
short type2;
int *memid;
short *act_length2; /* member uic */
int terminator; /* end of list indicator */
};
icpunix1()
{
char *p1, *p2;
char *str = "This is something to test with";
int group_id, ret_length1, member_id, ret_length2;
int status, t1 ,nxtst;
struct JPI_ITEM_LIST items;
$DESCRIPTOR(syscmd, "SYS$COMMAND");
$DESCRIPTOR(process_table, "LNM$PROCESS"); /* process logical name table */
char equiv_sys_command[20] = "_TESTNAME";
int crelnm_attributes = 512; /* LNM$M_TERMINAL */
struct {
unsigned short a_buffer_length;
unsigned short a_item_code;
int *a_buffer_address;
short *a_return_length_address;
unsigned short s_buffer_length;
unsigned short s_item_code;
char *s_buffer_address;
short *s_return_length_address;
int end;
} crelnm_itmlst = {4, 3, &crelnm_attributes, 0,
strlen(equiv_sys_command), 2, &equiv_sys_command, 0, 0};
items.type1 = JPI$_GRP, items.length1 = 4, items.grpid = &group_id; items.act_length1 = &ret_length1;
items.type2 = JPI$_MEM, items.length2 = 4, items.memid = &member_id; items.act_length2 = &ret_length2;
items.terminator = 0;
nxtst = 0;
if ((status = SYS$CRELNM(0, &process_table, &syscmd, 0, &crelnm_itmlst)) != SS$_NORMAL) goto error;
nxtst++;
if ((strcmp(ctermid(0), equiv_sys_command)) != 0) goto error;
nxtst++;
if ((status = SYS$GETJPIW(0, 0, 0, &items, 0, 0, 0)) != SS$_NORMAL) goto error;
nxtst++;
if (group_id != getgid()) goto error;
nxtst++;
if (member_id != getuid()) goto error;
nxtst++;
if (setuid() != NULL) goto error;
nxtst++;
if (setgid() != NULL) goto error;
nxtst++;
t1 = time(0);
sleep(5);
if ((time(0) - t1) < 5) goto error;
nxtst++;
if ((status = nice(0)) == -1) goto error;
nxtst++;
if ((p1 = malloc(200)) == NULL) goto error;
strcpy (p1, str);
nxtst++;
if ((p2 = realloc(p1, 600)) == NULL) goto error;
if (strcmp (p2, str) != 0) goto error;
nxtst++;
if (free(p2) != 0) goto error;
return(success);
error:
printf("\nERROR in ICP in routine icpunix1 test #%d\n", nxtst);
return(fail);
}
icpunix2()
{
int nxtst, fd1, fd2;
FILE *fp;
char *buf1 = "A fleeting stop, a momentary taste / Of Being from the well amid the waste \
/ And lo! the phantom caravan moves on -- / Oh make haste!";
char buf2 [512];
nxtst=0;
umask (0111);
nxtst++;
if ((fd1 = creat("icptmp5.tmp",0777)) == -1) goto error2;
nxtst++;
if (access("icptmp5.tmp",001) != -1) goto error;
nxtst++;
if (chmod ("icptmp5.tmp", 0777) == -1) goto error;
nxtst++;
if (access ("icptmp5.tmp", 001) != 0) goto error;
nxtst++;
if (umask(0) != 0111) goto error;
nxtst++;
if ((fd2 = dup(fd1)) == -1) goto error2;
nxtst++;
if ((fp = fdopen (fd1, "w+")) == NULL) goto error2;
if (write (fd1, buf1, strlen(buf1)+1) != strlen(buf1)+1) goto error2;
nxtst++;
rewind (fp);
if (read (fd2, &buf2, 512) == EOF) goto error2;
nxtst++;
if (strcmp (buf1, &buf2) != 0) goto error2;
fclose (fp);
close (fd2);
if (delete ("icptmp5.tmp") == -1) goto error2;
return (success);
error:
umask(0);
error2:
printf ("\nERROR in unix2 test #%d\n",nxtst);
return (fail);
}
/*
*
* This function is a compile-time test that references
* every RTL entry point. It is not meant to be invoked.
*
*
*/
icpchk()
{
double x,y;
cabs_t z;
time_t *t;
timeb_t *tb;
tbuffer_t *tbu;
FILE_TYPE *fp;
JMP_BUF_TYPE jmp;
int i,j,fd;
unsigned ui;
char *a;
void *vp;
double atof();
printf("\nFunction ICPCHK() should not be invoked.\n");
return(success);
/*
ENTRY POINT MODULE FUNCTION */
abort(); /* C$ABORT Aborts the current process */
abs(); /* C$ABS Integer absolute math library function */
access(); /* C$UNIX Checks the accessiblity of a file */
acos(x); /* C$ACOS Arcosine math library function */
alarm(ui); /* C$ALARM Set alarm library function */
asin(x); /* C$ASIN Arcsine math library function */
atan(x); /* C$ATAN Arctangent math library function */
atan2(x,y); /* C$ATAN2 Arctangent math library function */
atof(); /* C$ATOF Converts floating-point ASCII to binary */
atoi(); /* C$ATOI Converts long ASCII to binary */
atol(); /* C$ATOI Converts long ASCII to binary */
brk(); /* C$BREAK Determines the lowest virtual address for the program */
cabs(z); /* C$HPOT Euclidian distance math library function */
calloc(); /* C$MALLOC Allocates and clears storage */
ceil(x); /* C$CEIL Ceiling math library function */
chdir(); /* C$UNIX Changes the default directory */
chmod(); /* C$UNIX Changes a file's access mode */
chown(); /* C$UNIX Changes a file's owner */
close(); /* C$UNIX Closes a file */
cos(x); /* C$COS Cosine math library function */
cosh(x); /* C$COSH Hyperbolic cosine math library function */
creat(); /* C$UNIX Creates a file */
ctermid(); /* C$CTERMID Identifies the controlling terminal */
ctime(); /* C$TIMEF Converts time in seconds to a 26 character string */
cuserid(); /* C$CUSERID Identifies the username */
delete(); /* C$UNIX Deletes a file by file name */
dup(); /* C$UNIX Creates a duplicate file descriptor */
dup2(); /* C$UNIX Creates a duplicate file descriptor */
ecvt(); /* C$ECVT Converts a double value to an ASCII string, rounding to the right */
execl(); /* C$UNIX Executes a program image with an argument list */
execle(); /* C$UNIX Executes a program image with an argument list and environment vector */
execv(); /* C$UNIX Executes a program image with an argument vector */
execve(); /* C$UNIX Executes a program image with an argument vector and environment vector */
exit(); /* C$EXIT Closes files and exits */
_exit(); /* C$UNIX Exits the program image */
exp(x); /* C$EXP Base e exponentiation math library function */
fabs(x); /* C$FABS Floating point double absolute math library function */
fclose(fp); /* C$FCLOSE Closes a file */
fcvt(); /* C$ECVT Converts a double value to an ASCII string in FORTRAN F-Format */
fdopen(fd,a); /* C$FDOPEN Opens a file by file descriptor */
fflush(fp); /* C$FFLUSH Flushes a file buffer */
fgetc(fp); /* C$FGETC Gets a character from a file */
fgetname(fp,a); /* C$FGETNAME Gets a filename string */
fgets(); /* C$FGETS Gets a string from a file */
floor(x); /* C$FLOOR Floor math library function */
fopen(a,a); /* C$FOPEN Opens a file by file pointer */
fprintf(fp,a); /* C$PRINTF Formats and writes a string to an output file */
fputc(i,fp); /* C$FPUTC Formats and writes a string to a file */
fputs(a,fp); /* C$FPUTS Writes a string to a file */
fread(vp,i,j,fp); /* C$FREAD Reads items of a specified number and size from a file to a buffer */
free(); /* C$MALLOC Deallocates storage */
freopen(a,a,fp); /* C$FOPEN Closes and reopens a file */
frexp(x,&i); /* C$FREXP Extract fraction and exponent math library function */
fscanf(fp,a); /* C$SCANF Formats input from a file */
fseek(fp,i,j); /* C$FSEEK Positions to a byte offset within a file */
ftell(fp); /* C$FTELL Returns current byte offset within a file */
ftime(tb); /* C$TIME Gets the time of the epoch and the fractional time */
fwrite(vp,i,j,fp); /* C$FWRITE Writes items of a specified number and size from a buffer to a file */
gcvt(); /* C$GCVT Converts a double value to an ASCII string and places the string in a buffer */
getchar(); /* C$GETCHAR Gets a character from standard input */
getenv(); /* C$GETENV Gets the environment */
getegid(); /* C$GETGID Gets the effictive group identification */
getgid(); /* C$GETGID Gets the group identification */
getname(); /* C$UNIX Gets a file name string */
getpid(); /* C$GETPID Gets the process identification */
gets(); /* C$GETS Gets a string from standard input */
geteuid(); /* C$GETUID Gets the effective user identification */
getuid(); /* C$GETUID Gets the user identification */
getw(fp); /* C$GETW Gets a long word from an input file */
gsignal(i); /* C$SIGNAL Generates a signal */
hypot(x,y); /* C$HYPOT Euclidian distance math library function */
isatty(); /* C$UNIX Checks for a terminal file */
kill(i,j); /* C$KILL Sends signal to process */
ldexp(x,i); /* C$LDEXP Power of 2 math library function */
localtime(); /* C$TIMEF Converts time in seconds to broken down time */
log(x); /* C$LOG Logrithm base e math library function */
log10(x); /* C$LOG10 logrithm base 10 math library function */
longjmp(jmp,i); /* C$SETJMP Returns to the entry point of its associated setjmp */
lseek(); /* C$UNIX Establishes a position in a file */
malloc(); /* C$MALLOC Allocates an area of contiguous bytes in memory */
mktemp(); /* C$TMPNAM Makes a temporary file name string */
modf(x,&y); /* C$MODF Extract fraction and integer math library function */
nice(); /* C$NICE Sets process priority */
open(); /* C$UNIX Opens a file by file descriptor */
pause(); /* C$PAUSE Suspends the process until a signal is received */
perror(); /* C$PERROR Prints an error message */
pipe(); /* C$UNIX Allows two processes to exchange data */
pow(x,y); /* C$POW Power math library function */
printf(a); /* C$PRINTF Formats and writes a string to standard output */
putchar(); /* C$PUTCHAR Writes a character to standard output */
puts(a); /* C$PUTS Writes a string to standard output */
putw(i,fp); /* C$PUTW Writes a long word to a file */
rand(); /* C$RAND Computes a random number */
read(); /* C$UNIX Reads a file */
realloc(); /* C$MALLOC Changes the size of an area of storage */
rewind(fp); /* C$REWIND Returns file pointer to the beginning of the file */
sbrk(); /* C$BREAK Adds a number of bytes to the lowest virtual address */
scanf(fp,a); /* C$SCANF Formats input from the standard input */
setbuf(fp,a); /* C$SETBUF Associates a buffer with a file */
setgid(); /* C$SETGID Sets group identification */
setjmp(jmp); /* C$SETJMP Sets up an entry point for a possible longjmp */
setuid(); /* C$SETUID Sets user identification */
signal(i,vp); /* C$SIGNAL Sets a signal */
sin(x); /* C$SIN Sine math library function */
sinh(x); /* C$SINH Hyperbolic sine math library function */
sleep(ui); /* C$SLEEP Suspends the process for a number of seconds */
sprintf(a,a); /* C$PRINTF Formats and writes a string to a memory buffer */
sqrt(x); /* C$SQRT Square root math library function */
srand(); /* C$RAND Reinitializes the random number generator */
sscanf(a,a); /* C$SCANF Formats input from a character string in memory */
ssignal(i,vp); /* C$SIGNAL Sets a signal */
strcat(); /* C$STRCAT Concatenates two strings */
strchr(); /* C$STRCHR Searches for the first occurrence of a given character in a string */
strcmp(); /* C$STRCMP Compares two strings */
strcpy(); /* C$STRCPY Copies a string to another string */
strcspn(); /* C$STRCSPN Searches a string for an occurrance of a character in a set */
strlen(); /* C$STRLEN Determines the length of a string */
strncat(); /* C$STRNCAT Concatenates two strings, up to a maximum number of characters */
strncmp(); /* C$STRNCMP Compares two strings, up to a maximum number of characters */
strncpy(); /* C$STRNCPY Copies a number of characters from one string to another, either padding or
truncating the input string */
strpbrk(); /* C$STRPBRK Searches a string for one of a set of characters */
strrchr(); /* C$STRRCHR Searches a string for the last occurence of a given character */
strspn(); /* C$STRSPN Searches a string for any characters that are not in a set */
tan(x); /* C$TAN Tangent math library function */
tanh(x); /* C$TANH Hyperbolic tangent math library function */
time(t); /* C$TIME Gets the time of the epoch */
times(tbu); /* C$UNIX Gets the process and CPU times */
tmpfile(); /* C$TMPFILE Creates a temporary file */
tmpnam(); /* C$TMPNAM Generates a file name for a temporary file */
tolower(); /* C$TOLOWER Converts uppercase to lowercase */
toupper(); /* C$TOUPPER Converts lowercase to uppercase */
ungetc(i,fp); /* C$UNGETC Pushes a character back onto the buffer */
umask(); /* C$UNIX Sets a file's protection mask */
vfork(); /* C$UNIX "virtual fork" */
wait(); /* C$UNIX Suspends process while waiting for a child process */
write(); /* C$UNIX Writes a file */
}
Software Performance Reports for VAX C, Version 2.3-000.
11-CS00442 The compiler bug checked if the source program contained
an expression of the form "p[i]", where "p" was declared
as a pointer to a structure or union which had not yet
been defined. This problem was fixed in Version 2.0; the
compiler now issues the UNDEFSTRUCT error message against
such a reference.
11-CS00558 See SPR 11-68978.
11-CS00570 See SPR 11-72377.
11-CS00732 See SPR 11-CS00442.
11-CS01110 See SPR 11-70961.
11-CS01111 When an expression using a comma operator was used as an
argument to a function, and when the right operand was an
array name, the compiler erroneously deleted the left
operand. This problem was fixed in Version 2.1.
11-CS01224 The following code generated an incorrect value for the
variable, d0:
main ()
{
unsigned long d0, d2, min;
d2 = 75L;
min = 0L;
d0 = d2 - ((min * 100.0/10000.0) * d2)/100;
printf("d0 = %ld, d2 = %ld. /n", d0, d2);
}
This problem was fixed in Version 2.0.
11-CS01251 Incorrect object code was generated for the assignment
statement in the inner loop in the following code
fragment:
unsigned short int array [MAXELEMENTS][PARTS];
:
for (i = 1; i < MAXELEMENTS; i++)
{
for (j = 0; j < PARTS; j++)
{
array [0][j] |= array [i][j];
}
}
This problem was fixed in Version 2.0.
11-CS01745 See SPR 11-78451.
Page 2
11-CS01839 No diagnostic message was issued if the operand of a
sizeof operator was an array whose size was not known at
compile time. This problem is fixed in Version 2.2.
11-CS01895 See SPR 11-78451.
11-CS01905 If a compilation invoked with the command line qualifier
/LIST=TT: was interrupted by CTRL/C, the compiler might
loop, continuously issuing the COMPILERR message. This
problem is fixed in Version 2.2.
11-CS02012 See SPR 11-80766.
11-CS02113 See SPR 11-CS01905.
11-CS02186 See SPR 11-78451.
11-CS03817 There was no way to indicate to the compiler that a
specific program variable should not be optimized in such
a way, for example, that its most recent value was not
accessible to an AST routine. This has been fixed by the
implementation of the volatile specifier in version 2.3 of
VAX C.
11-58803 The values that may be specified in case labels were
limited to the range of -32768 to 32767. This restriction
was removed in Version 2.0.
11-60309 See SPR 11-58803.
11-68978 The compiler bug checked during code binding if the source
program contained a typedef-name declared as a "function
returning ...", if the name was then used in an internal
function declaration, if the storage class of the declared
function was unspecified, and if the declared function was
called before it was defined. This problem was fixed in
Version 2.0.
11-69850 The compiler neglected to issue a warning message if the
expression in a return statement did not match the type of
the return value in the function definition. This problem
was fixed in Version 2.0.
11-69851 The compiler did not issue an error message if a pointer
variable was used as a function. This problem was fixed
in Version 2.0.
11-69919 Two system error message symbols were misspelled in the
include module ssdef. These were corrected in Version
2.0.
11-69933 This SPR reported eight problems:
1. The compiler may have bug checked during the parser
phase if the source program contained a declaration of
Page 3
a multidimensional array via a typedef-name, and where
at least one (but not all) of the dimension bounds was
specified by the typedef-name, without an explicit
bound value. This problem was fixed in Version 2.0.
2. The compiler may have produced invalid object code if
the source program contained an if statement which
contained an expression common to the source code
outside of the statement. This problem was fixed in
Version 2.0.
3. The compiler may have produced invalid object code if
an expression involving the comma operator appeared in
the context of a test (for, if, etc.) and the
rightmost operand of the comma list was an expression
involving a logical AND (&&) or OR (||) operation; the
compiler failed to evaluate the preceding operands.
This problem was fixed in Version 1.3.
4. The compiler may have generated an erroneous external
reference to a global symbol if a typedef-name is
declared to be a function. This problem was fixed in
Version 2.0.
5. The compiler may not have generated a position-
independent reference if the source program contained
an expression which took the address of an external
object. This problem was fixed in Version 2.0.
6. The compiler may have issued the NOSTRDEF warning
message against a pointer to (or function returning) a
structure which had not yet been fully defined at that
point in the source program. Subsequent references to
such a pointer or function may have elicited various
error messages, even if the structure had become fully
defined since last referenced. This problem was fixed
in Version 1.5.
7. The compiler may have issued the INVALINIT warning
message against a declaration that contained an
initializer consisting of an expression involving a
subtraction operator. This problem was fixed in
Version 2.0.
8. The compiler could have generated inefficient object
code for an expression that tested the value of a
one-bit field, if the field happened to be allocated
at the low order bit of a byte. This problem was
fixed in Version 2.0.
11-70238 The compiler did not issue a diagnostic message if the
source program contained a declaration in which a char or
short variable is initialized with a pointer value. This
problem was fixed in Version 2.0.
Page 4
11-70575 When writing data to a spooled terminal, two listings were
produced, one of which had zero length. This problem was
fixed in Version 2.0; VAX C no longer closes and then
reopens files when writing to a spooled terminal.
11-70669 See SPR 11-70238.
11-70961 The compiler bug checked during the optimizer phase when
encountering a negative case label in a switch statement
located within a for or while loop. This problem was
fixed in Version 2.0.
11-70988 The compiler may have bug checked during the parser phase
if a #define preprocessor control line was embedded in a
declaration, and if the identifier defined in the control
line was the same as an identifier in the declarator list.
This problem was fixed in Version 2.0.
11-71219 See SPR 11-70961.
11-71286 The compiler failed with a bug check during code
generation with the following example program:
long maketime()
{
int daytb[13], yday, mon, day, leap;
yday = daytb[mon] + ((leap && mon) ? 0 : 1)
while (yday == 3);
}
This problem was fixed in Version 2.0.
11-71618 The following construct caused the compiler to bug check
in the parser phase:
double test = ((unsigned) 1) * 1.0;
This problem was fixed in Version 2.0.
11-71634A The compiler incorrectly optimized a reference to a
variable, where its address was used later in the program,
cast as a pointer to a structure. This problem is fixed
in Version 2.2.
11-71753 The following lines of code caused the compiler to bug
check in the code generation phase:
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
main()
{
int j, arr[1024];
arr[MAX(j,j)] = MAX(j,j);
}
This problem was fixed in Version 2.0.
Page 5
11-71790 Declarations of external names which were identically
spelled except for case were not consistently diagnosed by
the compiler. In some instances, the discrepancies lead
to Linker diagnostics, but in other cases, they simply
generated incorrect object code. This problem was fixed
in Version 2.0.
11-71814 The compiler failed to detect an illegal function call;
the compiler treated any pointer as a possible pointer to
a function. This problem was fixed in Version 2.0.
11-72326 The compiler issued an INVALINIT warning message against a
declaration that contained an initializer expression that
resolved to a structure member offset. This problem was
fixed in Version 2.0.
11-72377 Conversion from unsigned long int to double produced
incorrect results when the unsigned value was zero. This
problem was fixed in Version 2.0.
11-72614 The compiler may have bug checked if a tag name was used
incorrectly in a declaration; for example, if an enum tag
was later used in a structure declaration. The compiler
did not distinguish between the three types of tags:
enum, struct, and union. This problem was fixed in
Version 2.0.
11-72623 Unsigned characters with the high bit set did not compare
correctly with a constant when a pointer was used to
access them; the compiler was not properly recognizing
that the character constant was signed and the character
variable was unsigned. This problem was fixed in Version
2.0.
11-72634 The compiler generated an erroneous MOVL instruction where
the destination operand is a word-sized object. This
problem was fixed in Version 2.0.
11-72890 The compiler erroneously removed a MOVF instruction from
conditional and looping statements. This problem was
fixed in Version 2.0.
11-73810 If the initializer in the declaration of an externally
defined static or globaldef variable was in itself another
externally defined static or globaldef variable, the
declared variable was initialized with the address of the
initializer variable; this was an invalid initialization
that should have been flagged by the compiler. This
problem was fixed in Version 2.0.
11-74609 The compiler may have failed to generate correct code for
references to a member of a structure or union; the
problem occurred when the member of the structure or union
was referred to by address on the left side of an
assignment expression and by value in the right side of
Page 6
the expression as in the following:
*(&struct_name.member) = struct_name.member + ...
This problem was fixed in Version 2.0.
11-75193 The compiler produced incorrect results when storing the
results of a bitwise operation in a variable declared to
be either unsigned short or unsigned long. This problem
was fixed in Version 2.0.
11-75359 The compiler did not produce identical code for identical
lines located in separate cases within the same switch
statement. This problem was fixed in Version 2.0.
11-75570 See SPR 11-70961.
11-75595 The compiler incorrectly references static functions when
referenced in an array of pointers to functions. This
problem was fixed in Version 2.0.
11-75596 See SPR 11-CS00442.
11-75609 When using a structure or union variable name (or some
other lvalue) to qualify a member belonging to another
declared structure or union, the compiler only issued the
NONSEQUITUR diagnostic message if /STANDARD=PORTABLE was
specified on the command line. As of Version 2.0, the
compiler unconditionally issues the NONSEQUITUR message as
an "informational."
11-75767 See SPR 11-70961.
11-75768 See SPR 11-70961.
11-75921 See SPR 11-72377.
11-75973 See SPR 11-72377.
11-76120 When the command line exceeded 132 characters, the
compiler failed to reproduce the entire command line in
the listing. This problem was fixed in Version 2.0.
11-76187 The compiler incorrectly applied the arithmetic conversion
rules to the operand of the unary minus sign (-) when the
operand is a variable of data type unsigned char or
unsigned short. This problem was fixed in Version 2.1.
11-76312 When programs contained an extraordinary number of
initializers in a single structure declaration, the symbol
table may have become too large for the compiler to
manipulate, thus causing the SYMTABOVFL diagnostic
message. This problem was fixed in Version 2.0.
11-76780 In some cases, when adding or subtracting valid code from
Page 7
an existing file, the compiler bug checked in the
optimizer phase. This problem was fixed in Version 2.0.
11-76870 See SPR 11-70961.
11-76878 The compiler produced MOVL instructions when MOVB
instructions were needed. This problem was fixed in
Version 2.0.
11-76947 The default C condition handler re-enables the delivery of
ASTs even if such delivery has been previously disabled.
Documentation was added to the Version 2.1 release notes
warning of this side effect.
11-77005 When attempting to fill gaps created when assigning
addresses to static variables, the compiler assigned the
same address to several variables. This problem was fixed
in Version 2.0.
11-77048 See SPR 11-70961.
11-77261 The compiler failed to flag two external declarations that
differed only in case. The compiler should have generated
the CONFLICTDECL diagnostic message. This problem was
fixed in Version 2.0.
11-77262 See SPR 11-77261.
11-77397 The compiler generated an extremely large jump table that
depended on the overall range of the associated case label
values, not one that depended on the number of cases.
This problem was fixed in Version 2.0.
11-77399 See SPR 11-58803.
11-77475 The compiler provides only minimal support for the
Symbolic Debugger. This restriction was removed in
Version 2.0.
11-77549 The compiler did not diagnose the use of a pointer to a
structure if the structure had not been defined in the
compilation. This problem was fixed in Version 2.0.
11-77746 Under certain circumstances, the compiler generated
incorrect object code when optimizing an expression
involving array references inside a for loop. This
problem is fixed in Version 2.2.
11-77869 When compiling the file TT.C, the compiler sent output to
the terminal screen, not to TT.OBJ. This problem was
fixed in Version 2.0.
11-78111 See SPR 11-70961.
11-78226 See SPR 11-72623.
Page 8
11-78451 The set of include modules supplied with VAX C is
incomplete, and, in some cases, contained outdated or
erroneous information. Version 2.2 supplies the following
new modules: libdef, lnmdef, prcdef, syidef, and xwdef.
Version 2.2 also contains corrections to the following
modules: atrdef, dcdef, dvidef, fab, fchdef, fibdef,
iodef, jpidef, lckdef, msgdef, nam, opcdef, prvdef,
rmsdef, smgdef, and ttdef.
11-78550 The compiler failed with a bug check during code
generation when it attempted to compile the following
program:
struct p_tag { int field; };
test (param)
struct p_tag *param;
{
int i;
for (i = -4; i != 0; i++)
{
if (param -> field == 1) continue;
check (param, param -> field);
param -> field == 1; /* redundant */
}
}
This problem is fixed in Version 2.2.
11-78567 See SPR 11-70961.
11-78837 See SPR 11-70961.
11-78867 See SPR 11-70961.
11-78951 See SPR 11-70961.
11-79110 See SPR 11-70961.
11-79141 See SPR 11-70961.
11-79288 The compiler aborted after exceeding the virtual memory
limit, if the following conditions were present:
o The program contained an error, thus eliciting a
diagnostic message;
o The logical name SYS$ERROR had been assigned to a
file;
o The program was being compiled for a second (or
subsequent) time.
This problem is fixed in Version 2.2.
11-79433 The compiler did not diagnose the use of subscripts with a
Page 9
function name. This problem is fixed in Version 2.2.
11-79628 The compiler incorrectly moved an expression out of a loop
if the expression referenced a formal parameter that had
been declared with the register storage class. This
problem is fixed in Version 2.2.
11-79860 The compiler failed with a bug check during code binding
if the source program contained a declaration specifying
an array whose elements were of zero length, and the
program was compiled with the /DEBUG command line
qualifier. This problem is fixed in Version 2.2.
11-80049 The compiler did not ignore the character sequence "/*" if
it appeared within a character string in a macro
definition, and erroneously issued the UNEXPEOF and
UNEXPEND diagnostic messages. This problem is fixed in
Version 2.0.
11-80170 Under certain conditions, the compiler generated incorrect
code for a test of the low order bit of a byte.
Typically, the generated code used a BLBS instruction when
it should have used a BLBC, or vice-versa. This problem
is fixed in Version 2.2.
11-80342 See SPR 11-70961.
11-80399 The compiler did not diagnose the invalid initialization
of a structure containing a member which was a union,
unless the union was the first member of its enclosing
structure. This problem is fixed in Version 2.2.
11-80492 The compiler generated incorrect object code if the source
program contained a sequence of code similar to the
following:
i = p;
:
... p -> q + i ...
This problem is fixed in Version 2.2.
11-80546 See SPR 11-80170.
11-80640 The compiler failed with a bug check during code
generation if the source program was such that it required
a large number of register temporaries in the early part
of the source code. This problem is fixed in Version 2.2.
11-80766 The compiler failed with a bug check during code
generation if the source program contained an expression
in which an integer variable was right-shifted. The
problem occurred if the variable was external, was 1, 2,
or 4 bytes long, and the shift amount was a nonzero
multiple of 8 bits. This problem is fixed in Version 2.2.
Page 10
11-80831 See SPR 11-79628.
11-80867 See SPR 11-78451.
11-80954A See SPR 11-79628.
11-81067 The compiler generated incorrect object code for a program
containing a loop in which elements of an array of
structures were the targets of assignment statements. The
problem occurred in an assignment to a structure member
which was a bit field of more than 8 bits. This problem
was fixed in Version 2.1.
11-81199 See SPR 11-70238.
11-81288 See SPR 11-78451.
11-81674 The compiler always generated a reference to the psect
$ADDRESS_DATA in the object file, even though that psect
was never used. As of Version 2.2, such a reference is no
longer generated.
11-81769 The compiler erroneously issued several UNDEFSTRUCT error
messages when the second and third operands of a
conditional expression operator were pointers to a
structure or union which had not yet been defined in the
source program. This problem is fixed in Version 2.2.
11-81808 The compiler issued an INVALINIT warning message against
an initializer expression intended to evaluate to the
offset of a structure or union member, plus or minus a
constant, if the variable being initialized was declared
with a non-automatic storage class. This problem is fixed
in Version 2.2.
11-81898 The compiler bug checked during optimization if the source
program contained declarations of an extraordinarily large
number of identifiers. This problem is fixed in Version
2.2.
11-81931 The compiler erroneously issued the PARAMREDECL warning
message against a declaration appearing in an inner block.
This problem is fixed in Version 2.2.
11-82009 The compiler failed with a bug check during code
generation if the source program contained a reference of
the form "p->a[i].v", where "p" was either a constant or a
pointer which had been assigned a constant value, "a" was
an array of structures, and "v" was a bit field whose
offset was at least one bit from the beginning of its
parent structure. This problem is fixed in Version 2.2.
11-82564 See SPR 11-79628.
11-82576 If a compilation elicited the SYNTAXERROR diagnostic
Page 11
message, and the message text (which contains a list of
expected tokens) was excessively lengthy, the last four
bytes of the message were corrupted. This problem is
fixed in Version 2.2.
11-82789 Under certain circumstances, the compiler generated object
code that incremented the index variable of a for loop
twice per iteration. The problem was most likely to occur
if there was an assignment to an array subscripted by the
index variable, and the assignment target was then
immediately reused. This problem is fixed in Version 2.2.
11-82973 The compiler generated incorrect object code such that a
reference to an element of an array contained inside a
structure which is a formal parameter (passed by value)
causes an access violation. This problem is fixed in
Version 2.2.
11-84168 See SPR 11-78451.
11-84485 See SPR 11-78451.
11-84740 The compiler bug checked during the parser phase if a
program containing an unusually long and complex macro
expansion was compiled with the command line qualifier
/SHOW=INTERMEDIATE (or /SHOW=ALL). This problem is fixed
in Version 2.2.
11-84742 The compiler failed with a bug check during optimization
(or during code binding if /NOOPTIMIZE had been specified
on the command line) if the source program satisfied all
of the following conditions:
o It contained a switch statement;
o The body of the switch statement contained executable
statements between the left brace opening the body of
the switch statement and the first case or default
label (if any) within the body;
o The above code contained a for, while or do loop
construct within which was nested either a
user-defined label or another switch statement.
This problem is fixed in Version 2.2.
11-84743 The compiler failed with a bug check during the parser
phase if the source program contained a very long string
constant containing a large number of character "escape
sequences". This problem is fixed in Version 2.2.
11-84743A See SPR 11-84743.
11-85169 See SPR 11-79628.
Page 12
11-85314 See SPR 11-78451.
11-85470 See SPR 11-79628.
11-85792 See SPR 11-80640.
11-85826 See SPR 11-79433.
11-86070 See SPR 11-84743.
11-86098 The compiler bug checked during the optimization phase if
the source program contained a formal function parameter
declared with the register storage class, and the only
references to the parameter occurred in code that was
unreachable. This problem is fixed in Version 2.2.
11-86290 See SPR 11-79628.
11-02682 The compiler generated the INVCONST warning message
against any decimal constant whose absolute value exceeded
2147483647. The compiler will now accept constants up to
4294967295, the largest value that can be stored in an
unsigned int. This problem is fixed in Version 2.3.
11-82268 The compiler sometimes failed with a bug check during the
optimization phase if the source program contained a very
complex expression inside a loop. Although it is
difficult to state the precise conditions (in terms of
source code) that caused the problem to occur, the failing
expression was one which contained both a loop-invariant
sub-expression, and a sub-expression which could be
commoned with other sub-expressions within the loop. This
problem is fixed in Version 2.3.
11-82528 See SPR 11-02682.
11-82858 The compiler failed with a bugcheck during the parser
phase when encountering syntax which indicated the use of
the keyword "short" as a function. This problem is fixed
in Version 2.3.
11-83525 See SPR 11-02682.
11-84033 The compiler failed with a bugcheck if the source program
contained an arithmetic expression in which one or more of
the operands was a constant cast as a pointer. This
problem is fixed in Version 2.3.
11-84121 See SPR 11-02682.
11-84546 The compiler failed to generate code for the
initialization of an array of characters if the array had
automatic storage class and the initializer specified a
null string. This problem is fixed in Version 2.3.
Page 13
11-84589 The compiler did not generate any warning on encountering
the application of the "&" operator to array or function
names. This problem is fixed in Version 2.3.
11-86037 The compiler sometimes failed with a bugcheck if the
source program contained an attempt to pass a structure or
union larger than 65535 bytes as a function argument.
This problem is fixed in Version 2.3.
11-87067 The compiler sometimes generated an incorrect call
instruction when a conditional expression was used to
determine the primary expression in a function call. This
would only occur if the function name used as the "true"
expression was declared as a static function.
For example, the problem occurred in this statement if
afunc was declared as static:
(* (boolvar ? afunc : bfunc)) ();
This problem is fixed in Version 2.3.
11-87740a The compiler sometimes failed with a bugcheck during the
optimization phase if the source program contained at
least two common subexpressions, and one or more of them
(other than the first) were optimized away. This problem
is fixed in Version 2.3.
11-87891 The compiler failed with a bugcheck during the
codegeneration phase if the source program contained an
attempt to negate a structure. This problem is fixed in
Version 2.3.
11-87973 A VAX C program could fail at execution time with an
access violation if it contained a *for* loop specifying a
control variable declared as *double*, and the loop
termination expression involved a comparison of the
control variable using the *<=* operator, and the program
was compiled with the /G_FLOAT command line qualifier.
This problem is fixed in Version 2.3.
11-88482 The compiler failed with a bugcheck during the parser
phase when the source program contained an invalid attempt
to declare a pointer to a variant union. This problem is
fixed in Version 2.3.
11-88550 The % operator produced incorrect results when the
denominator was a large unsigned number (i.e. greater
than 214748364), and the sum of the numerator and
denominator was greater than 4294967295. This problem is
fixed in Version 2.3.
11-89495 A program with certain combinations of floating point
constants could fail to subtract properly when it was
compiled with /G_FLOAT. In the submitted program, the
Page 14
statement causing the problem was:
/* improper evaluation of subtraction */
b = a - 1.4 - 2.2;
This problem is fixed in Version 2.3.
11-89509 A program which used the opc$l_ms_text field (defined in
OPCDEF.H) would always generate the NONSEQUITUR
informational when compiled. OPCDEF.H has been modified
to prevent this problem in Version 2.3.
11-89546 This SPR reported two problems:
1. The compiler sometimes fail with a bugcheck during the
parser phase if the source program contained an
extraordinarily long statement. In the submitted
program, the statement causing the problem is of the
form:
if (...) { ... } else if (...) { ... }
else if (...) { ... } ... etc.
The bugcheck occurred in the vicinity of the 80th
*else* clause.
2. The compiler failed with a bugcheck during code
generation when compiling the following program:
index (s, t)
char s[], t[];
{
int i, j, k;
for (i = 0; s[i] != '\0'; i++)
for (j=i; k=0; t[k] != '\0' && s[j]==t[k]; j++, k++)
/* ^-- This semicolon should have been a comma */
;
return i;
}
Both problems are fixed in Version 2.3.
11-90191 Under certain circumstances, the compiler would enter an
infinite loop, repeatedly issuing a fatal diagnostic
message. This problem is fixed in Version 2.3.
11-90515 The compiler could fail with a bugcheck during the parser
phase if the source program contained an extraordinarily
long statement. Such a statement could be generated by an
attempt to expand a reference to a recursively defined
macro;+ for example:
#define A 1
#define B (A||(B))
:
printf ("%d", B);
Page 15
This problem is fixed in Version 2.3.
11-90953 The compiler failed to issue the NOTPARAMETER diagnostic
if an identifier which was declared as a function in the
parameter declaration section did not appear in the
parameter list. This problem is fixed in Version 2.3.
11-91215 The Version 2.2 compiler sometimes generated incorrect
code for simple switch statements when extraneous
statements appeared between the switch expression and the
first case label. Whenever the first case was to be
executed the extraneous statements would also be executed.
This problem is fixed in Version 2.3.
11-91427 The compiler failed with a bugcheck in the parser phase if
the source program contained an invalid attempt to do
pointer arithmetic with a pointer to a function. This
problem is fixed in Version 2.3.
11-92236 The compiler would sometimes generate incorrect code when
assigning unsigned bit strings from records to other bit
strings. If the source bit string occupied a word or
less, it would sometimes be zero extended to long-word
length while being moved to its destination, even if the
destination string was only allocated a word, possibly
causing other variables to be overwritten. The problem is
fixed in Version 2.3.
11-92562 A missing semicolon at the end of a structure declaration
immediately preceding the start of a main program resulted
in the generation of incorrect object code for references
to the parameters "argc", "argv", and "envp". In Version
2.3, the INVMAINRETVAL warning message will be issued on
the specification of an non-integral type as the return
type of the main function.
11-92806 When the CC command qualifier /MACHINE_CODE was used to
obtain a listing of the instructions generated for a
compilation, any floating point instruction operands
generated in either the short literal or immediate
addressing modes were displayed as integers rather than as
the appropriate floating point values. This is fixed in
Version 2.3.
11-93508 The INVALINIT warning diagnostic was issued against the
initialization of a structure, if one of the members of
the structure was a union and the member immediately
preceding the union was initialized (even though the union
member itself is not initialized). The problem is fixed
in Version 2.3.
11-93699 The compiler ignored the readonly storage class modifier
when it appeared inside a function body without the
storage class specifiers static or extern. The VAX C
documentation states that such declarations should default
Page 16
to extern. This problem is fixed in Version 2.3 of the
compiler.
11-94318 A warning diagnostic was issued when readonly, a storage
class modifier, followed the global storage class
specifiers globalvalue or globalref. This is fixed in
Version 2.3 of the compiler.
11-94394 The object code generated for a switch statement might be
incorrect if the body of the switch statement contained
three or fewer case labels (including any default label),
and there existed source code between the opening brace of
the body and the first such label. This is fixed in
Version 2.3.
11-94608 Any character string which contained over 1000 characters
in its specification (counting "\0" as two characters) and
contained an embedded null in those first 1000 characters,
would have all the characters between the first "\0" and
the 1000th character replaced by nulls. This was fixed in
Version 2.3 of the compiler.
11-94917 The VARARGS facility did not work correctly within a
function returning a large object. VARARGS returned the
wrong number of arguments and the first argument returned
was bad. This is fixed in Version 2.3.
11-95275 A VAX C program might fail at execution time with an
access violation if it contained a for loop specifying a
control variable declared as double, and the loop
termination expression involved a comparison of the
control variable using the <= operator, and the program
was compiled with the /G_FLOAT command line qualifier.
This is fixed in Version 2.3.
11-95817 VAX C definition module TTDEF.H was not updated to VMS
V4.4. This has been fixed in Version 2.3.
11-95774 The VAX C compiler could encounter a spurious CDD record
extraction condition under certain circumstances. The
same CDD record definition could be compiled without error
using VAX COBOL, VAX BASIC, or VAX PL/I. This has been
fixed in Version 2.3.