HP Integrity Servers HP aC++/HP ANSI C Release Notes Version A.06.
© Copyright 2008 Hewlett-Packard Development Company L.P. All rights reserved Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice.
Table of Contents 1 HP aC++/HP ANSI C Release Notes...........................................................................................7 2 What’s New in This Version........................................................................................................9 New Features in Version A.06.20.........................................................................................9 Decimal floating-point arithmetic (HP-UX 11.31 only) (New).......................................
_Asm_ld, _Asm_ldf, _Asm_st, _Asm_stf Intrinsics (New)...........................................25 Debugging Code Compiled with Opt Levels above +O1 Is Supported........................25 __attribute__ ((visibility("default"|"protected"|"hidden"))) Added (New)..................25 __attribute__ ((warn_unused_result)) Added (New)...................................................25 Change in treatment of cv-qualified assignment operators..........................................25 New Features in Version A.
GPREL22 Relocation Error ................................................................................................35 Object Files Generated at +O4 or -ipo.................................................................................36 Incompatibilities Between the Standard C++ Library Ver. 1.2.1 and the Draft Standard..............................................................................................................................36 Conflict Between macros.
1 HP aC++/HP ANSI C Release Notes The information in this document applies to the release of HP aC++ and HP ANSI C compilers version A.06.20 for the HP-UX 11i v2 and v3 operating system on Integrity servers. The HP ANSI C compiler supports ANSI programming language C standard ISO 9899:1990. HP aC++ compiler supports the ISO/IEC 14882 Standard for the C++ Programming Language (the international standard for C++). HP ANSI C and HP aC++ are distributed as a single software bundle.
2 What’s New in This Version This chapter gives an overview of the new command line options and features introduced in this version of the HP aC++/HP C compiler. Version A.06.20 of the HP aC++/HP C compiler provides complete source and binary compatibility with earlier versions of the A.06.xx family. New Features in Version A.06.20 Version A.06.20 of the HP aC++ compiler supports the following new features: • • • • • • • • • • • • • • Decimal floating-point arithmetic (HP-UX 11.
example, 123.00 + 45.6 = 168.60 and 123.00 * 0.01 = 1.2300. These special quantum semantics facilitate exact fix-point calculation. For typical floating-point calculations, the quantum semantics can be ignored. Decimal FP support includes the following: • Three built-in decimal FP types: _Decimal32 • • • • • • • • • 10 _Decimal64 _Decimal128 with 7, 16, and 34 decimal digits of precision, respectively.
• • option does not affect the precision of parameters, return types, or assignments. The default is -fpevaldec=_Decimal32. Type-generic functions in that take on the type of decimal FP (or binary FP) arguments. Our Decimal FP support incorporates code from the Intel Decimal Floating-Point Math Library. To use decimal FP: • Install the following on an HP-UX 11i V3 (11.
const char * ofilename = "biller.out"; // output file const enum { ascii, bid, dpd } encoding = ascii; // input encoding const _Decimal64 rate = 149.95DD; // hourly billing rate #define __STDC_WANT_DEC_FP__ #include #include #include #include #include #include
if (s == 0) { fprintf(stderr, "FAILURE: on input from %s\n", ifilename); fclose(inp); fclose(outp); exit(EXIT_FAILURE); } if (s == EOF) break; } else if (encoding == bid) { r = (int) fread(&be, sizeof(_Binaryencoding64), 1, inp); if (r != 1) break; m = _decodebinary64(be); // decode bid } else /* encoding == dpd */ { r = (int) fread(&de, sizeof(_Decimalencoding64), 1, inp); if (r != 1) break; m = _decodedecimal64(de); // decode dpd } // compute hours billed fe_dec_setround(FE_DEC_UPWARD); h = m / 60; h = qu
return 0; } Notes: • The quantize functions do the work of rounding to the desired number of places to the right of the decimal point. They return the value of their first argument represented with the quantum exponent of their second argument, rounding if necessary. • Mixing decimal FP and integer operands, as in the expression m / 60, is allowed. However, the expression m / 60.0, which mixes decimal and binary FP, would cause an error.
• • • The thread waits on a condition variable for which the associated mutex is not locked. The thread terminates execution, and the resources associated with the terminated thread continue to exist in the application because the thread has not been joined or detached. The thread uses more than the specified percentage of the stack allocated to the thread. The +check=thread option should only be used with multithreaded programs. It is not enabled by +check=all.
-dumpversion (New) The -dumpversion option displays the simple version number of the compiler, such as A.06.20. Compare with the -V option, which displays more verbose version information. #include_next (New) The #include_next preprocessor directive is similar to the #include directive, but tells the preprocessor to continue the include-file search beyond the current directory, and include the subsequent instance found in the file-search path.
Was this: warning #4045-D: non-constant initialization performed at runtime • Non-static inline can't reference static: error #3031-D: an entity with internal linkage cannot be referenced within an inline function with external linkage • Use of inline or restrict as variables/functions/types. New diagnostics will be added to warn users about the use of inline and restrict in this release (A.06.20).
• • • • • • • • • • • • • • • +O[no]loop_unroll_jam (Default Changed) +Olit=all is the new default for HP C (Change) +macro_debug= Option (New) +pathtrace Option (New) +check Suboptions (New) -Bhidden_def Option (New) -dM Option (New) #pragma OPT_LEVEL INITIAL (New) #pragma OPTIMIZE (Deprecated) #pragma [NO]INLINE (New for C++ mode) _Asm_ld, _Asm_ldf, _Asm_st, _Asm_stf intrinsics added (New) Debugging code compiled with opt levels above +O1 now supported (New) __attribute__ ((visibility("default"|"protecte
This option limits the number of instantiation contexts output by the compiler for diagnostics involving template instantiations. At most num outermost contexts and num innermost contexts are shown. If there are more than 2 * num relevant contexts, the additional contexts are omitted. Omitted contexts are replaced by a single line separating the outermost num contexts from the innermost num contexts, and indicating the number of contexts omitted. The default value for num is 5.
+O[no]autopar Option (New) +O[no]autopar This release adds support on the Itanium platform for a new optimization -auto-parallelization - which is enabled by adding the +Oautoparoption to the command-line. This optimization allows applications to exploit otherwise idle resources on multicore or multiprocessor systems by automatically transforming serial loops into multithreaded parallel code.
+O[no]loop_unroll_jam (Default Change) At optimization levels 3 and 4, the default for this option has changed from +Onoloop_unroll_jam to +Oloop_unroll_jam, which allows automatic loop unroll-and-jam. +Olit=all (Default Change for HP C) The default in C mode of the compiler is now +Olit=all, placing string constants in read-only memory by default. This change over previous versions of the compiler (which defaulted to +Olit=const) improves performance and is in keeping with similar changes in the industry.
+nomacro_debug suppresses emission of macro debug information into the object file. +pathtrace (New) +pathtrace[=kind] The +pathtraceoption provides a mechanism to record program execution control flow into global and/or local path tables. The saved information can be used by the HP WDB debugger to assist with crash path recovery from the core files, or to assist when debugging the program by showing the executed branches.
+check=globals +check=truncate[:explicit|:implicit] The following new suboptions have been added to the +check=bounds option: +check=bounds:array +check=bounds:pointer +check=bounds:all +check=bounds:none Descriptions: • +check=globals The +check=globals option enables runtime checks to detect corruption of global variables by introducing and checking "guards" between them, at the time of program exit.
pointer all none Enables check for out-of-bounds references to buffers through pointer access. The buffer could be a heap object, global variable, or local variable. This suboption also checks out-of-bounds access through common libc function calls such as strcpy, strcat, memset, and so on. This check can create significant run-time performance overhead. Enables out-of-bounds checks for both arrays and pointers. This is equal to +check=bounds:array +check=bounds:pointer. Disables out-of-bounds checks..
#pragma OPTIMIZE (Deprecated) As of this release of the compiler, #pragma OPTIMIZE is deprecated. Use #pragma OPT_LEVEL instead. #pragma [NO]INLINE (New for C++ Mode) Previously, #pragma [NO]INLINEwas supported only on HP C and aC++ C-mode. With this release, #pragma [NO]INLINEis now supported in C++ mode as well.
int main() { S s1, s2; s1 = s2; const S s3; s3 = s2; return 0; // calls implicitly generated operator // previously used to call the user-defined one // still calls the user-defined operator }" New Features in Version A.06.12 Version A.06.
• • • • -AA -D_HP_NONSTD_FAST_IOSTREAM performance Macro (New) New function attributes Improved Diagnostics C++ Standard Library HP Code Advisor This release introduces a new tool "HP Code Advisor", that can be used for detecting various programmer errors in C/C++ source code. Use this tool to identify potential coding errors, porting issues and security errors. The HP Code Advisor is being made available on both HP-UX PA and Integrity servers.
+Ointeger_overflow (Default Changed) The default setting for all optimization settings is now "moderate".+Ointeger_overflow=moderate +Onolibcalls= Option (New) +Onolibcalls= allows you to turn off optimization for listed fun ctions. +Onolibcalls=function1,function2,... This allows you to turn off libcall optimizations (inlining or replacement) for calls to the listed functions. This overrides system header files.
The config file options before the "|" character set the defaults for compilations, and the options after the character override the user’s command line settings. NOTE: No configuration files are shipped along with aC++, but can be installed by the system administrator, if required. [NO]PTRS_TO_GLOBALS Pragma #pragma [NO]PTRS_TO_GLOBALS This pragma aids alias analysis.
Improved Diagnostics Diagnostic messages now include more context to aid in tracing their root causes, including an improved template instantiation traceback. C++ Standard Library Change Technical Corrigenda 1 has changed the STL function make_pair to take their arguments by value instead of const reference. This change brings the HP library into compliance if the enabling macro -D__HP_TC1_MAKE_PAIR is specified at compile time. For binary compatibility reasons, the default behavior is unchanged.
3 Installation Information Read this entire document and any other release notes or readme files you may have before you begin an installation. To install your software, run the SD-UX swinstall command. This invokes a user interface that will lead you through the installation. For more information about installation procedures and related issues, refer to Managing HP-UX Software with SD-UX and other README, installation, and upgrade documentation provided or described in your HP-UX 11.
4 Compatibility Information Maintaining binary compatibility is a key release requirement for new versions of HP aC++. The compiler has maintained the same object model and calling convention and remains compatible with the HP-UX runtime in the code that it generates as well as its intrinsic runtime library (libCsup) across the various releases of HP aC++ and its run-time patch stream.
int main() { printf("%d\n",sizeof(A)); } Migrating From HP C++ (cfront) to HP aC++ The compiler lists Errors, Future Errors, and Warnings. Expect to see more warnings, errors and future errors reported in your code, many related to standards based syntax. For more complete information, refer to the HP aC++ Transition Guide at: http:// www.hp.
5 Known Problems and Workarounds This section describes known problems and workarounds. Customers on support can use the product number to assist them in finding SSB and SRB reports for HP aC++ or HPC. The product number you can search for is B3910BA. To verify the product number and version for your HP aC++ or HP C compiler, execute the following HP-UX commands: what /opt/aCC/bin/aCC what /opt/aCC/lbin/ecom Obsolete LANG-STARTUP Files As of HP aC++ version A.06.
Workaround: The declaration should be changed to: extern uint64_t variable[]; This error can also occur in assembly code if items <= 8 bytes are put into.data/.bss instead of .sdata/.sbss. Workaround (assembler): For "small" variables defined in assembly, change the section name from .bss to .sbss or .data to .sdata: .section .sdata = "asw", "progbits" .
The following flags are now automatically set with A.05.* and A.06.* compilers: • • • • • • • -D__HPACC_USING_MULTIPLIES_IN_FUNCTIONAL -D__HPACC_THREAD_SAFE_RB_TREE -D__HPACC_USING_MULTIPLIES_IN_FUNCTIONAL -D__HPACC-FIX_FUNC_ADAPTER_OPERATOR -D__HPACC_FULL_ITERATOR_REL_OPS -D__HPACC_TEMPLATE_PAIR_CTOR -D__HPACC_MEM_FUN_ADAPTOR Conflict Between macros.h and numeric_limits Class (min and max) If your code includes /usr/include/macros.h, note that the min and max macros defined in macros.
• Known limitations of exception handling features: — Interoperability with setjmp/longjmp (undefined by the ISO/ANSI C++ international standard) is unimplemented. Executing longjmp does not cause any destructors to be run. — If an unhandled exception is thrown during program initialization phase (that is, before the main program begins execution) destructors for some constructed objects may not run. — HP aC++ does not support the linker option -Bsymbolic.
This will insure that, when the application is migrated to a system that has a later version of libA available, the actual version desired is the one that is dynamically loaded. • Memory Allocation Routine alloca() The compiler supports the built in function, alloca, defined in the /usr/include/alloca.h header file. The implementation of the alloca() routine is system dependent, and its use is not encouraged. alloca() is a memory allocation routine similar to malloc() (see malloc(3C)).
6 Related Documentation Documentation for HP aC++ / HP C is described in the following sections. Online Documentation The following online documentation is included with the HP aC++/HP C products: • HP aC++ Programmer’s Guide Access this guide in any of the following ways: — Use the +help command line option: /opt/aCC/bin/aCC +help — From your web browser, enter the appropriate URL: file:/opt/aCC/html/C/guide/index.
• Rogue Wave Software Standard C++ Library 2.2.1 User’s Guide This guide gives information about library usage and includes an extensive discussion of locales and iostreams. The guide is provided as HTML formatted files. You can view these files with an HTML browser by opening the file /opt/aCC/html/libstd_v2/stdug/ index.htm or select the hyperlink in the main online help topic for HP aC++. • Rogue Wave Software Standard C++ Library 1.2.
Online C++ Example Source Files Online C++ example source files are located in the /opt/aCC/contrib/Examples/ RogueWave directory. These include examples for the Standard C++ Library and for the Tools.h++ Library. Printed Documentation HP aC++/HP C Release Notes is this document. A printed copy of the release notes is provided with the HP aC++ / HP C product. Release notes are also provided online, as noted above.
*B3901-90031* Printed in the US