Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP aC++ Version A.03.10 Release Notes: HP Series 9000 > Chapter 3 Related Documentation

Other Documentation

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

Refer to the HP aC++ Online Programmer's Guide Information Map for documentation listings, URL's, and course information related to the C++ language. Also, see below.

The following documentation is available for use with HP aC++. To order printed versions of Hewlett-Packard documents, refer to manuals(5).

  • HP/DDE Debugger User's Guide contains information on debugging C++ programs with the HP Distributed Debugging Environment on the HP 9000.

  • Parallel Programming Guide for HP-UX Systems (B6056-90006) describes efficient parallel programming techniques available for the
    HP Fortran 90, HP C, and HP aC++ compilers on HP-UX.

    This document is available on the HP-UX 11.0 CD-ROM and on the World Wide Web at the following URL:

    http://docs.hp.com/hpux/development/

    To order a paper copy, contact Hewlett-Packard's Support Materials Organization (SMO) at 1-800-227-8164 and provide the above part number.

Difference in Class Size when Compiling in 32-bit versus 64-bit Mode

The size of a class containing any virtual function varies when compiled in 32-bit mode versus 64-bit mode. The difference in size is caused by the virtual table pointer (a pointer to an internal compiler table) in the class object. The pointer is created for any class containing one or more virtual functions.

When compiling the following example in 32-bit mode, the output is 8. In 64-bit mode, the output is 16.

extern "C" int printf(const char *,...);

class A {
int a;
public:
virtual void foo(); //virtual function foo, part of class A
};

void A::foo() {
return;
}

int main() {
printf("%d\n",sizeof(A));
}

Content of .o Files may Change

The following applies when you use an aCC command-line option 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

    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

Selectively Interpret a Warning or Future Error as an Error

Syntax: -WC,-diaga[serror],arg

The above syntax allows you to selectively interpret any specified warning or future error as an error. arg is a valid compiler warning message number.

Example:   aCC -Wc,-diaga,600 -WC,-diaga,829 app.C

Note, this functionality will have its own simple option in a future release.

The Named Return Value (NRV) Optimization

Syntax:   -Wc,-nrv_optimization,[off|on]

The above syntax 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 aC++ run-time support library that comes with HP aC++ A.01.04 or a subsequent 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++ run-time support library (libCsup.sl).

The NRV optimization eliminates a copy-constructor call by allocating a local object of a function directly in the caller's context if that object is always returned by the function. For example:

struct A {
A(A const&); // copy-constructor
};

A f(A const& x) {
A a(x);
return a; // Will not call the copy constructor if the
} // optimization is enabled.

This optimization will not be performed if the copy-constructor was not declared by the programmer. Note that although this optimization is allowed by the ISO/ANSI C++ working paper, it may have noticeable side-effects.

Example:   aCC -Wc,-nrv_optimization,on app.C

Linker Compatibility Warnings

Beginning with the HP-UX 10.20 release, the linker generates compatibility warnings. These warnings include HP 9000 architecture issues, as well as linker features that may change over time. Compatibility warnings can be turned off with the +v[no]compatwarnings linker option. Also, detailed warnings can be turned on with the +vallcompatwarnings linker option.

Link time compatibility warnings include the following:

  • Linking PA-RISC 2.0 object files on any system — PA-RISC 1.0 programs will run on 1.1 and 2.0 systems. PA-RISC 2.0 programs will not run on 1.1 or 1.0 systems.

  • Dynamic linking with -A — If you do dynamic linking with -A, you should migrate to using the Shared Library Management Routines. These routines are also described in the sh_load(3X) man page.

  • Procedure call parameter and return type checking (which can be specified with -C) — The current linker checks the number of symbols, parameters, and procedure calls across object files. In a future release, you should expect HP compilers to perform cross-module type checking, instead of the linker. This impacts HP Pascal and HP Fortran programs.

  • Duplicate names found for code and data symbols — The current linker can create a program that has a code and data symbol with the same name. In a future HP-UX release, the linker will adopt a single name space for all symbols. This means that code and data symbols cannot share the same name. Renaming the conflicting symbols solves this problem.

  • Unsatisfied symbols found when linking to archive libraries — If you specify the -v option with the +vallcompatwarnings option and link to archive libraries, you may see new warnings.

  • Versioning within a shared library — If you do versioning within a shared library with the HP_SHLIB_VERSION (C and C++) or the SHLIB_VERSION (Fortran and Pascal) compiler directive, you should migrate to the industry standard and faster performing library-level versioning.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1998 Hewlett-Packard Development Company, L.P.