 |
Standard Compliance
ISO C++
The current standard for C++ is
International Standard ISO/IEC 14882-1998(E)
Programming languages -- C++.
A copy of the ISO C++ standard can be purchased on the WEB from the
ANSI Electronic Standards Store.
In the KAI C++ documentation, we refer to this standard as ISO C++.
When operating in C++ mode, KAI C++ is extremely close to ISO C++.
The C++ Deficiencies section of this
document lists all known places where KAI C++ deviates from ISO C++.
ISO C
The current standard for C is
International Standard ANSI/ISO 9899-1990 for Programming Languages C,
as modified by ANSI/ISO/IEC 9899-1996 Amendment 1: C Integrity.
A copy of the ISO C++ standard can be purchased on the WEB from the
ANSI Electronic Standards Store.
In the KAI C++ documentation, we refer to this standard as ISO C.
When operating in C mode, KAI C++ is conformant to ISO C.
POSIX Threads
The current standard for threads is
ISO/IEC 9945-1:1996 Information Technology
-- Portable Operating System Interface (POSIX) -- Part 1: System Application:
Program Interface (API) [C Language].
A copy of the POSIX Threads standard can be purchased on the WEB from the
IEEE Standards Catalog.
In the KAI C++ documentation, we refer to this standard as POSIX Threads.
KAI C++ does not provide an implementation of POSIX Threads.
Instead, each operating system manufacturer provides an implementation of
POSIX Threads. Conformance with the POSIX Threads standard is left
up to the operating system manufacturer.
KAI C++ does provide a command line option,
--thread_safe,
which causes KAI C++ to generate code that is
compatible with the operating system's implementation
of POSIX Threads.
For C++ this means somewhat more than the traditional
re-entrant code.
It includes the use of POSIX synchronization primitives to
ensure:
- exactly one construction of each static object;
- no uses before that construction completes;
- proper destruction of same; and
- mutual exclusion of all accesses to shared objects hidden
by the C++ implementation.
Checking Standard Conformance
Normally, KAI C++ operates in a relaxed mode where many common
extensions to C and C++ are accepted.
There are command line options for requesting that no extensions
to ISO C++ or ISO C be allowed.
ISO C++
The command line option --strict selects full compliance
with the ISO C++ syntax/semantics (chapter 1-16).
On some systems, the type long long is used in a few system header files.
This type is not ISO C++ conforming. To allow this type, but enforce conformance
otherwise, use the command line option sequence
--strict --long_long.
On Linux systems, a great many system header files directly or indirectly use the type
long long.
The option alias --linux_strict
specifies both the --strict and
--long_long options.
On some Linux systems, illegal constructs appear in a few header files (e.g., a zero-length
aggregrate type as the last member of a structure). To instruct the parser to permit
such constructs, but issue a warning, the command line option
--linux_headers
is turned on by default. For strict compliance, use
--no_linux_headers.
The provided header files and libraries are very close to being fully compliant
with the ISO C++ standard template library definitions (chapters 17-27).
Older codes may conflict with recent additions to the standard. Several macro symbols
are available to smooth the migration path.
ISO C
Use the --c --strict command line options
to select full conformance to ISO C.
C++ Deficiencies
Syntax/Semantic Features
These elements of the language syntax or semantics are not implemented
in KAI C++ version 4.0.
- Two-phase name binding in templates, as described in [temp.res] and
[temp.dep] of the standard
- A partial specialization of a class member template cannot be added outside of the class definition.
- Universal character set escapes (e.g.,
\uabcd)
- The
export keyword for templates
Class Library Features
These elements of the standard class library are not implemented
in KAI C++ version 4.0.
- Selecting locale by "name"
- Standard header files still define some spurious names of
extern "C" library
functions in the global and std namespaces.
Undocumented Deviations
If you encounter deviations from ISO C++, ISO C or POSIX Threads
that are not documented, please
let us know!
|