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

In order to disambiguate this situation in favor of the user-provided subscript operator[],
make the conversion of 0 in alternative (1.) no worse
1
than the conversion of 0 in
alternative (2.).
Because the subscript type for the built-in operator[] is ptrdiff_t (as defined in
<stddef.h>), this is also the type that should be used for user-defined subscript
operators. Replace the previous example by:
#include <stddef.h>
struct String {
char& operator[](ptrdiff_t);
operator char*();
// ...
};
void f(String &s) {
s[0] = 0;
}
Execution Order of Static Constructors in Shared Libraries
In HP C++ (cfront), static constructors in shared libraries listed on the link-line are executed,
by default, in left-to-right order. HP aC++ executes static constructors in depth-first order;
that is, shared libraries on which other files depend are initialized first. Use the -depth
command-line option on the CC command line for enhanced compatibility with HP aC++.
In addition, HP aC++ reverses the initialization order of .o files on the link-line. To aid
in migration, you can group all .o files together and all .so files together.
Example:
aCC file1.o file2.o lib1.so lib2.so lib3.so
In this scenario, cfront would initialize file2.o first, and then file1.o, while HP
aC++ initializes file1.o and then file2.o. You must take this into account in your
cfront code to avoid link problems with HP aC++.
More Frequent Inlining of Inline Code
HP C++ does not inline some functions even when you request for it. This happens when
the function is too complex. If you use the +w option, the compiler displays a message
whenever it does not inline a requested function.
HP aC++ almost always inlines functions for which you have specified the inline
keyword.
1. worse is relative to a ranking of conversions as described in the ANSI/ISO C++ International Standard on
overloading. In general, a user-defined conversion is worse than a standard conversion, which in turn is
worse than no conversion at all. The complete rules are more fine grained.
Migration Considerations Related to Standardization 263