HP C/aC++ Version 6 Features to Improve Developer Productivity
2
Introduction
The most time consuming and expensive task in software development is to find and fix defects.
The later a defect is found in the software development process, the costlier it gets. A bug found
and fixed at the coding or testing stages is better and less expensive than the same found by a user
after the product release. The HP compilers for Integrity provide a number of features to help
software developers detect potential problems in their programs earlier in the process.
Compile time diagnostics and Run time checks are provided to allow the developer to identify many
common problems before the code is checked in. In addition, the compiler supports enhanced
debugging capabilities. Execution Path Recovery feature of the compiler can provide backtracking
of the execution path from the crash point in a core file or from a breakpoint in the debugger
All of the above features of the compiler lower maintenance and support costs and free up
developers to spend more time implementing new features.
What’s New
The A.06.20 release of the HP C and C++ compilers provides +check=lock|thread feature, in
addition to improvements on the features provided by older versions.
The A.06.15 release of the HP C and C++ compilers provides +wlock, +wperfadvice, +Wmacro
and +check=bounds:pointer|gobals|truncate features, in addition to improvements on the
features provided by older versions. This version also introduces the execution path recovery
(+pathtrace) feature to backtrack the execution path from the crash point in a core file or from a
breakpoint in the debugger.
The A.06.10 release of the HP C and C++ compilers provides +wendian option and improvements
to the existing developer productivity features. This release also introduces a new C/C++ static
analysis tool, HP Code Advisor, which provides all the compile time diagnostic features of Integrity
compilers. This tool is available free of cost on HP-UX Integrity and PA-RISC. For more information,
visit the
HP Code Advisor (cadvise) homepage.
The compiler features to improve developer productivity are available starting with the A.06.05
release of the HP C and C++ compilers. The A.06.05 release provides +wlint, +w64bit,
+wsecurity and +check=all|none|bounds|malloc|stack|uninit options.
The Version 6 of HP C and C++ compilers provide a rich set of diagnostics that are available by
default and with +w, +Oinfo and +Oinitcheck options.
Compile Time Diagnostics
The HP compilers contain numerous checks for potential correctness problems. Some diagnostics
are emitted by default while others are enabled via explicit options listed below:
+wlint
This option enables several warnings in the compiler that are similar to the functionality of lint check.
These compile time diagnostics can be very useful in detecting potential problems in the source
code. The number of warnings with this option may be up to 5-10 times more than those emitted by
default by the compiler.