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-UX Systems: HP aC++ Release Notes > Chapter 1 HP aC++ Release Notes

New Features in Version A.03.30

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

New features in HP aC++ version A.03.30 are listed below.

Standard C++ Library 2.0 Base on the New Rogue Wave SL 2.0

The new -AA command line option enables use of the new 2.0 Standard C++ Library, which includes the new standard conforming (templatized) iostream library. This is the first release of the 2.0 library. It conforms to the ISO C++ standard.

The 2.0 library is a new addition to the HP C++ runtime is not compatible with the version 1.2.1 Standard C++ Library previously bundled with HP aC++. HP aC++ will continue support for standard C++ library 1.2.1 without name or location change. Customers should not notice any change when -AA is not used. However, the 1.2.1 library is deprecated and will be replaced by the new library eventually.

If you wish to use the new 2.0 library, you must use the -AA option consistently to compile and link all translation units. Mixing object files within an executable is not supported.

The version of the 2.0 Standard C++ library (libstd_v2) included in this release is incompatible with the previous versions of the same library. Using the -AA option and the new 2.0 library creates a binary incompatibility with any other applications or libraries compiled with the -AA option under the previous version of the aC++ product.

In order to use the new 2.0 library, you must recompile using the -AA option and you may need to apply a runtime and/or header file patch appropriate to your operating system (see list below). You do not need to install the header file patch if you use the A.03.30 compiler.The header file patches are needed for A.03.27, A.03.26, A.03.25, and A.01.27.

You can avoid the binary incompatibility simply by not using the -AA option and foregoing use of the 2.0 library. If you don’t use -AA, you should still install the patches. If you do use -AA and you are on A.03.30, the header file patches are included in A.03.30 but you must still install the runtime patches. Then you must recompile and relink any previous -AA application.

HP does not take the creation of binary incompatibilities lightly. When one is created, it is only after a careful consideration of options and ramifications. Our customers want to be able to use the new 2.0 library. Doing this also ensures compatibility with the Multibyte Support Extensions made in the 11i (11.11) release of HP-UX. The A.03.25 version (PHSS_21906) had an incorrect size and mangling for mbstate_t. The 11i defined value is 8 bytes, the libstd_v2 version is 4.

In particular the following template classes are now larger:

  • std::basic_filebuf<>

  • std::basic_fstream<>

  • std::basic_ifstream<>

  • std::basic_ofstream<>

  • std::fpos<std::mbstate_t>

  • std::mbstate_t

In addition to the possible silent corruption with this above change in size, the mangling was changed to better detect this compatibility problem by changing the name.

std::mbstate_t was changed to mbstate_t.

std::tm was changed to tm.

So if you developed on A.03.25 with the beta, A.03.26 on 11i or on 11.0 with the Ecommerce compiler, or A.01.27 for AR1200, or A.03.27 for AR1200, you will have the following problems if you do not install both the following header file and runtime library patches:

  • PHSS_22867 10.x header file

  • PHSS_22354 10.x runtime

  • PHSS_22868 11.x header file

  • PHSS_22543 11.0 runtime

  • PHSS_22898 11i runtime

NOTE: Applications developed on A.01.27 may not have these problems yet because there never was any runtime patch, except for a beta.

An ordinary program using iostreams experiencing this problem will get the following unsats:

  • If existing application runs on new runtime patch:

    /usr/lib/dld.sl: Unresolved symbol: do_out__Q2_3std14codecvt_bynameXTwTcTQ2_
    3std9mbstate_t_CFRQ2_3std9mbstate_tPCwT2RPCwPcT5RPc (plabel) from a.out_old

    /usr/lib/dld.sl: Unresolved symbol: do_in__Q2_3std14codecvt_bynameXTwTcTQ2_
    3std9mbstate_t_CFRQ2_3std9mbstate_tPCcT2RPCcPwT5RPw (plabel) from a.out_old
  • Trying to link with new runtime without new headers:

    /usr/ccs/bin/ld: Unsatisfied symbols:
    std::codecvt_byname<wchar_t,char,std::mbstate_t>::do_in(std::mbstate_t
    &,const char *,const char *,const char *&,wchar_t *,wchar_t *,wchar_t *&)
    const (code)

    std::codecvt_byname<wchar_t,char,std::mbstate_t>::do_out(std::mbstate_t
    &,const wchar_t *,const wchar_t *,const wchar_t *&,char *,char *,char *&)
    const (code)
  • Running application linked with new headers on old runtime:

    /usr/lib/dld.sl: Unresolved symbol: do_out__Q2_3std14codecvt_
    bynameXTwTcT9mbstate_t_CFR9mbstate_tPCwT2RPCwPcT5RPc (code) from a.out_new

    /usr/lib/dld.sl: Unresolved symbol: do_in__Q2_3std14codecvt_
    bynameXTwTcT9mbstate_t_CFR9mbstate_tPCcT2RPCcPwT5RPw (code) from a.out_new
  • Trying to link with old runtime with new headers:

    /usr/ccs/bin/ld: Unsatisfied symbols:
    std::codecvt_byname<wchar_t,char,mbstate_t>::do_out(mbstate_t
    &,const wchar_t*,const wchar_t *,const wchar_t *&,char *,char *,char
    *&) const (code)

    std::codecvt_byname<wchar_t,char,mbstate_t>::do_in(mbstate_t
    &,const char *,const char *,const char *&,wchar_t *,wchar_t *,wchar_t
    *&) const (code)

Easier User of Threads with -mt

The new -mt option enables multi-threading capability without the need to set any other flags, such as -l and -D. HP aC++ examines your environment and automatically selects and sets the appropriate flags.There are four possible sets of flags depending on your operating system and which libstd you use.

Option matrix for -mt:

          |    OS 10.20 (user thread)      |     OS 11.x (kernel thread)
---------+--------------------------------+-------------------------------
old-lib | -D_REENTRANT | -D_REENTRANT
libstd | -DRW_MULTI_THREAD | -DRW_MULTI_THREAD
1.2.1 | -DRWSTD_MULTI_THREAD | -DRWSTD_MULTI_THREAD
| -D_THREAD_SAFE | -D_THREAD_SAFE
& | | -D_POSIX_C_SOURCE=199506L
librwtool| |
7.0.x | -lcma | -lpthread
---------+--------------------------------+------------------------------
new-lib | -D_REENTRANT | -D_REENTRANT
(-AA) | -D_RW_MULTI_THREAD | -D_RW_MULTI_THREAD
| -D_RWSTD_MULTI_THREAD | -D_RWSTD_MULTI_THREAD
libstd | | -D_POSIX_C_SOURCE=199506L
2.2.1 | |
| -lcma | -lpthread
-----------+--------------------------------+-----------------------------------

Macros used to compile multi-thread source code:

  • _REENTRANT

    Required by system header files that provide reentrant functions (suffixed by _r).

  • RW_MULTI_THREAD/_RW_MULTI_THREAD

    Required by Rogue Wave toolsh++ header files and libraries. RW_MULTI_THREAD is used by toolsh++ 7.0.x. _RW_MULTI_THREAD is used by toolsh++ 8.x (not yet available).

  • RWSTD_MULTI_THREAD/_RWSTD_MULTI_THREAD

    Required by Rogue Wave standard library header files and libraries. RWSTD_MULTI_THREAD is used by libstd 1.2.1. _RWSTD_MULTI_THREAD is used by libstd 2.2.1 when compiling with -AA.

  • _POSIX_C_SOURCE=199506L

    Required by pthread.

  • Using -D__HPACC_THREAD_SAFE_RB_TREE:

    The Rogue Wave Standard C++ Library 1.2.1 (libstd) and Tools.h++ 7.0.6 (librwtool) are not thread safe if the underlying implementation rb_tree class is involved. In other words, if the tree header file (which includes tree.cc) under /opt/aCC/include/ is used, these libraries are not thread safe. Most likely, it is indirectly referenced by including the standard C++ library container class map or set headers, or by including a RogueWave tools.h++ header like tvset.h, tpmset.h, tpmset.h, tvset.h, tvmset.h, tvmset.h, tpmap.h.

    Since changing the rb_tree implementation to make it thread safe would break binary compatibility, the preprocessing macro __HPACC_THREAD_SAFE_RB_TREE must be defined. Whether or not this macro is defined when compiling a file that includes the tree header, its use must be consistent. For example, a new object file compiled with the macro defined should not be linked with older ones that were compiled without the macro defined. Library providers whose library is built with the macro defined may need to notify their users to also compile their source with the macro defined when the tree header is included.

    This macro is not set by -mt, You must set it explicitly on the command line.

  • _THREAD_SAFE

    Required by thread safe cfront compatible libstream header files and library. For the frequently used objects cout, cin, cerr, and clog, you can specify the -D_THREAD_SAFE compile time flag for any file that includes <iostream.h>. In this case, a new instance of the object is transparently created for each thread that uses it. All instances share the same file descriptor.

  • libcma.*

    User thread library used in 10.20 system.

  • libpthread.*

    Kernel thread library used on 11.x systems.

Partial Support for ANSI C Compiler

The -Ae option restricts the compiler to the ANSI C mode. This option turns on the ANSI C c89 mode and allows compilation of c89 compatible C source programs just like C compiler. Additional HP ANSI-C compiler features supported under the -Ae option may be enabled by this option in the future. For limitations see HP aC++ Online Programmer’s Guide.

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