TOC PREV NEXT INDEX DOC LIST MASTER INDEX



Apex C Language Constructs

The Apex C compiler accepts programs which conform to ISO/IEC 9899:1990, the 1990 version of the official standard for the C programming language. The compiler provides a limited number of extensions, mostly to simplify the task of writing header files intended to be shared by C and C++ programs. In addition, Rational recognizes that many C users must still support large programs which were written before this standard came into existence. Apex C provides a compatibility mode which causes the compiler to accept many language constructs made illegal by this standard.

The following topics are covered in this chapter:


Extensions


Supported Pragmas

The following pragmas directives are recognized:


Compatibility Mode

Compatibility mode is specified by use of the -K option on the command line to the Apex C compiler. This mode changes the semantic meaning of some constructs, and relaxes syntatic and semantic checking of others.

Changes Which Affect Program Meaning

Illegal Constructs Allowed

The following are accepted in compatibility mode. These are accepted silently unless explicitly noted as giving a warning below.

Warning Messages Suppressed

In ANSI mode, the Apex C compiler warns against the usage of many constructs which are considered unsafe or obsolete by the ANSI C standards committee. Many of these messages warning of possible program errors are disabled in compatibility mode.

Though the compiler warns against the following constructs in ANSI mode, an object file is still produced.


Implementation-Defined, Unspecified, and Undefined Behaviors

The ISO/ANSI C standard lists a number of behaviors that are implementation-defined. Implementations are required to document all of these behaviors. The standard also lists a large number of circumstances in which the behavior is unspecified or undefined. We have chosen to document the behavior in some of those circumstances. Because the operating system on which Apex C/C++ is run is always under the control of another company, we cannot fully document all the implementation-defined behaviors, but must is some cases refer the user to the operating system documentation. It is important to remember that none of the behaviors listed below should be relied upon when writing portable applications. Some of them are common to most UNIX systems, others to a particular variety of UNIX, and some are unique to this implementation. Any of them may be changed in a future release of the compiler.

Implementation-Defined Behavior

Translation

Environment

Identifiers

Characters

Integers

Floating Point

Arrays and Pointers

Registers

Structures, Unions, Enumerations, and Bit-Fields

Qualifiers

Declarators

Statements

Preprocessing Directives

Library Functions

The following implementation-defined behaviors are dependent on the target operating system. The behaviors listed apply only to embedded targets. For native systems, the host system documentation must be consulted.

Unspecified Behavior

Specified in This Implementation

The following behaviors, listed as unspecified by the ISO/ANSI C standard, are defined in this implementation.

Other behaviors listed as unspecified by the ISO/ANSI C standard are left unspecified in this implementation.

Undefined Behavior

Compile-Time Errors

The following behaviors, listed as undefined by the ISO/ANSI C standard, result in compile-time errors in this implementation.

Other Behavior

The following behaviors, listed as undefined by the ISO/ANSI C standard, are documented (to some extent) in this implementation.

Left Undefined

Other behaviors listed as undefined in the ISO/ANSI C standard are left undefined in this implementation.


Rational Software Corporation 
http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2002, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS