HP aC++ Release Notes Version A.03.95 (5900-1789; September 2011)

HP aC++ Release Notes
Compatibility Information
Chapter 1 71
void A::foo() {
return;
}
int main() {
printf("%d\n",sizeof(A));
}
Content of .o Files may Change
The following applies when you use the aCC command that invokes the assigner. The content of a given .o
file can potentially change when it is used in a closure (with the +inst_close option) or link operation.
The change may occur in either of the following cases:
You change the order of .o file’s on the link line. For example, if you compile and link A.c and B.c
multiple times as follows, the contents of A.o and B.o may not be the same following the second link
as they were following the first link:
aCC -c A.c B.c
aCC A.o B.o
aCC -c A.c B.c
aCC B.o A.o
You link a .o file with different objects. In the following example, the content of A.o may not be the
same following the second link as it was following the first link:
aCC A.o B.o
aCC A.o C.o
The Named Return Value (NRV) Optimization
The +[no]nrv option disables (default) or enables the named return value (NRV) optimization. For this
optimization to work correctly in conjunction with exception handling, the application must be linked to an
HP aC++ run-time support library that comes with version HP aC++ A.01.04 or a later version.
Linking with a prior library may cause spurious failures. If the shared version of this library is selected
(default), the platform on which the application is run must also have that release of the HP aC++ runtime
support library (libCsup.sl).
The NRV optimization eliminates a copy-constructor call by allocating a local object of a function directly
in the callers context if that object is always returned by the function. For example:
struct A {
A(A const&); // copy constructor
};