Chapter Contents

Previous

Next
SAS/C C++ Translator Changes in Release 7.50

Release 7.50 Changes and Enhancements to the C++ Translator

The following updates apply to SAS/C C++ Development System User's Guide.


Updates to Introduction to the SAS/C C++ Development System

The following updates apply to Chapter 1, "Introduction to the SAS/C C++ Development System."

Updates to C++ Language Definition

Make the following changes to the section titled "C++ Language Definition:"


Updates to Improved Conformance with the C++ Standard

Make the following changes to the section titled "Improved Conformance with the C++ Standard."


Updates to Environmental Elements

Make the following changes to the section titled "Environmental Elements:"

Replace the table labeled "Integral Type Sizes" with the following table:

Integral Type Sizes
Type Length in Bytes Range
bool
1 false, true
char
1 0 to 255 (EBCDIC character set)
signed char
1 -128 to 127
short
2 -32768 to 32767
unsigned short
2 0 to 65535
int
4 -2147483648 to 2147483647
unsigned int
4 0 to 4294967295
long (NOHUGEPTRS)
4 -2147483648 to 2147483647
unsigned long (NOHUGEPTRS)
4 0 to 4294967295
long (HUGEPTRS)
8 -9223372038854775808 to 9223372036854775807
unsigned long (HUGEPTRS)
8 0 to 18446744073709551615
long long
8 -9223372038854775808 to 9223372036854775807
unsigned long long
8 0 to 18446744073709551615
wchar_t
2 0 to 65535

Replace the table labeled "Float and Double Type Sizes" with the following table:

Float and Double Type Sizes
Type Length in Bytes Range
float
4 +/-5.4E-70 to +/-7.2E75 (_ _hexfmt)+/-1.4E-45 to +/-3.4E38 (_ _binfmt)
double
8 +/-5.4E-70 to +/-7.2E75 (_ _hexfmt)+/-4.9E-324 to +/-1.8E308 (_ _binfmt)
long double
8 +/-5.4E-70 to +/-7.2E75 (_ _hexfmt)+/-4.9E-324 to +/-1.8E308 (_ _binfmt)


Updates to Predefined Constants

In the section titled "Language Elements," make the following changes to the section titled "Predefined Constants:"


Updates to Language Extensions

Make the following changes in the section titled "Language Extensions:"


Additions to Language Extensions

Add the following sections to the "Language Extensions" section after the subsection titled "C++ iostream Library Constructors:"

Pragma options directive
The tranlator supports the #pragma options copts(...) directive, in a manner comparable to the C compiler. The following is a sample directive:
#pragma options copts(sname(ABC123))
Most of the options that the C compiler allows to be changed through #pragma options can also be specified for C++. Options like PPIX that are not supported for C++ compilations are also not supported through #pragma options in C++.

C99-style floating point constants
The translator supports the C99 hexadecimal floating-point constant format. This provides an alternative way to specify exact values for constants that have floating-point type. The syntax is:
0x<hexdecimal-digits>.<hexdecimal digits>P<binary exponent><suffixes>
For more details, see the section titled "Specifying floating-point constants in hexadecimal" in Chapter 2, "Source Code Conventions," of the SAS/C Compiler and Library User's Guide .

Explicit _ _binfmt and _ _hexfmt constant qualifiers
The translator allows a suffix of B or H to explicit specify that a floating point constant is in _ _binfmt or _ _hexfmt respectively. These suffixes can be used with all the floating point constant formats and follow any F or L suffixes. Note suffixes must be preceded by a period when they are used with the SAS/C hexadecimal format. For example 0.x4110.FH is a valid _ _hexfmt constant.


Updates to Implementation-Defined Behavior

Make the following changes to the section titled "C++ specific behaviors" In the section titled "Implementation-Defined Behavior:"


Update to the Anachronisms Section

Add the following item to the list in the section titled "Anachronisms:"


Updates to Translator Options

The following updates apply to Chapter 3, "Translator Options."

Updates to the Translator Options Table

In Chapter 3, "Translator Options," in the section titled, "Option Summary," replace the entries for asciiout, INLIne, and tronly in the table labeled, "Translator Options," with the following entries.

Translator Options
Option Name Default USS Environment Affects Process
ASCiiout
NOASCiiout
-Kasciiout
all T,C
INLIne
see description -Kinline
all G
TROnly
see description -Ktronly
all T

Add the following entries to the table labeled, "Translator Options."

Translator Options
Option Name Default USS Environment Affects Process
ARChlevel
see description -Karchlevel=let
all T,C
ARMode
NOARMode
-Karmode
all T,C
BFp
NOBFp
-Kbfp
all T,C
FRIendinject
NOFRIendinject
-Kfriendinject
all T
HUgeptrs
NOHUgeptrs
-Khugeptrs
all T,C
OPTIOns
OPTIOns
-Koptions
all L
TErm
see description -Kterm
all M


Updates to the Translator Options Descriptions

Make the following changes to the list of option descriptions in the section titled "Option Descriptions:"


Updates to Standard Libraries

The following updates apply to Chapter 4, "Standard Libraries."

Updates to Header Files


Update to C++ Complex Library

In the section titled "C++ Complex Library," add the following note after the first paragraph.

Note:   This library performs all computations using _ _hexfmt floating-point and expects its operands to be in this format.  [cautionend]

Updates to I/O Class Descriptions

Update "I/O Class Descriptions" with the following changes:


Updates to Buffer Class Descriptions

Update "Buffer Class Descriptions" with the following changes:


Updates to Header Files, Classes, and Functions

The following updates apply to Appendix 2, "Header Files, Classes, and Functions."

Update to Stream Classes

In the section titled "Stream Classes," in the table labeled "Header Files, Classes, and Functions for Streams," in the entry for stdiostream.h, delete the term stdiofile() from the Functions column.


Updates to Templates

The following updates apply to Appendix 3, "Templates."

Update to Template Parameters

Make the following changes to the section titled "Template Paremeters:"


Update to Template Arguments

In the section titled "Template Arguments," change the last list item to read:


Updates to Template Declarations and Definitions

Make the following changes In the section titled "Template Declarations and Definitions," in the section titled "Declaration Rules."


Updates to Function Templates

In the section titled "Function Templates," in the section titled "Deducing Arguments," add the following item at the end of the bulleted list:


Updates to Interpreting C++ Demangled Names

The following updates apply to Appendix 5, "Interpreting C++ Demangled Names."

In the section titled "Special Conventions Used in Demangled Names," add the following entries to the table labeled "Keywords and Their Abbreviations."

Keywords and Their Abbreviations
Keyword Abbreviation
_ _binfmt
_B
_ _far
_F
_ _huge
_H


New Appendix on ARMODE, HUGEPTRS, and Pointer Kinds

After Appendix 5, "Interpreting C++ Demangled Names," add a new appendix titled "ARMODE, HUGEPOINTERS, and Pointer Kinds" that contains the following information.

The C++ translator supports the HUGEPTRS and ARMODE options as well as the _ _near, _ _far, and _ _huge keywords in pointer and reference declarations. This appendix describes some of the special considerations for use of these SAS/C features with C++.

Pointer operations generally behave the same way with the C++ translator that they do with the C compiler. However the C++ translator is more restrictive about implicit pointer conversions in order to facilitate overloading and avoid unsafe conversions. Far and huge pointers cannot be converted to a different pointer kind without an explicit cast. As a special case pointers to strings and simple pointer expressions that can be determined at compile time to address auto, formal, static, or external objects can be implictly converted to near pointers.

References can be _ _near, _ _far, or _ _huge. By default object references are _ _near unless HUGEPTRS is specified, in which case they are _ _huge. Dereferencing a _ _huge reference requires the HUGEPTRS option. Dereferencing a _ _far reference requires ARMODE. With the HUGEPTRS option, only huge const references can bind to non-lvalues.

C++ specific pointer operations have their own restrictions. Conversion of a far pointer to a base class pointer requires the ARMODE option. Conversion of a huge pointer to a base class pointer requires the HUGEPTRS option. Applying dynamic_cast to far pointers or references requires the ARMODE option. Similarly, applying dynamic_cast to huge pointers or references requires the HUGEPTRS option.

Class object layout does not depend on the HUGEPTRS or ARMODE option except for differences due to user nonstatic data members. However a nonstatic member function always has a default sized this pointer. That is, in a HUGEPTRS compilation the this parameter will be a 64-bit huge pointer instead of a 32 bit near pointer. ARMODE does not affect the this pointer type. Virtual function calls to objects created in a different mode will cause unexpected results. Mixing HUGEPTRS and non-HUGEPTRS code is not generally recommended.

The new operator always returns a default sized pointer. The return type for an operator new function and the first argument for a delete function must be a default void pointer. The leftmost array size in an array allocation type can be a 64-bit quantity when HUGEPTRS is specified.

Enumeration constants and array sizes are limited to 32 bit values, except for the leftmost array size in a declarator for a new expression.

The std::bad_exception object thrown by the C++ library when a mismatched exception is encountered expects virtual function calls with 64-bit or 32-bit object pointers according to the mode (HUGEPTRS or NOHUGEPTRS) of the routine which included std::bad_exception in its exception specification.

The AT&T compatible streams and complex library supports HUGEPTRS. Note the cin, cout, cerr, and clog streams refer to different objects (with different layouts) in 64 and 32-bit modes. The Rogue Wave Standard C++ Library and Tools Library do not support HUGEPTRS.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.