HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)

Obsolete Preprocessor Options
HP aC++ provides support for ANSI/ISO C++ International Standard preprocessing.
Since the standard categorizes support of pre-ISO preprocessing as an anachronism,
the ANSI preprocessing options of HP C++ (cfront) are not supported. For a list of obsolete
preprocessor options, see Table 13: “Obsolete Command-Line Options” (page 249).
Migration Considerations Related to Standardization
The ANSI/ISO C++ International Standard redefines the rules, syntax, and features of
C++ language. If your existing code contains any of the standards based keywords as
variable names, you must change the variable names when you convert your program
to an HP aC++ program. In addition to keyword changes, there are changes in C++
Semantics and C++ Syntax.
Changes in C++ Semantics
Following lists the differences in code behavior when you migrate from HP C++ to HP
aC++:
Implicit Typing of Character String Literals
Overload Resolution Ambiguity of Subscripting Operator
Execution Order of Static Constructors in Shared Libraries
More Frequent Inlining of Inline Code
NOTE: These differences can occur inspite of compiling your code without errors.
Implicit Typing of Character String Literals
HP C++ implicitly types character string literals as char *. HP aC++, in accordance
with the ANSI/ISO C++ International Standard, types character string literals as
const char *. This difference affects function overloading resolution.
Example:
In the following code, HP aC++ calls the first function a; cfront calls the second.
void a(const char *);
void a(char *);
f() {
a(A_STRING);
}
To prevent existing code from breaking, assign a string literal to a non-const pointer.
Example:
char *p = B_STRING;
Migration Considerations Related to Standardization 261