Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Open System Services Porting Guide520573-006
3-1
3 Useful Porting Tools
By using the proper tools, you can significantly reduce the time and cost of porting
programs written in the C or C++ language from one computing platform to another.
Some tools check for the compatibility of C language source statements with the
ISO/ANSI C standard, while others are useful for determining which routines used by
the program are not available on the platform to which the program is being ported.
Because standards requirements are complicated and quite extensive, use an
automated porting checker for the following purposes:
To consistently demonstrate that your programs conform to standards and are
available on new platforms
To ensure that consistent results can be obtained in secure and sensitive
environments
To bring products to market quickly and within moderate operating margins
To reduce maintenance costs of existing products and quickly debug new code
The following subsections provide an overview of popular porting tools available for the
UNIX workstation:
lint Tool on page 3-1
findcalls Tool on page 3-2
CodeCheck Tool on page 3-3
Open Systems Portability Checker (OSPC) Tool on page 3-4
The purpose of this section is to provide an introduction to the concepts involved when
using porting tools to enhance the efficiency of porting applications and other
programs. For more information about using or obtaining these and other porting tools,
and how to use them when porting code to the OSS environment, contact your service
provider.
lint Tool
The lint tool is very important to portable C programming. lint examines
C language source programs, detecting bugs, inconsistencies, and poor constructs.
lint helps you follow a number of portability rules when moving programs from one
platform to another or between different operating systems. lint accepts multiple
input files and library specifications and checks them for consistency.
Although lint is very helpful for writing portable code, its importance is becoming
more of a historic one. It was one of the first porting tools available, and is still a
standard tool on UNIX machines. Today, there are more powerful porting tools
available, such as CodeCheck and OSPC (both discussed later in this section). lint
is not available on NonStop systems.
In addition, C compilers today perform most of the checking done by lint; this
includes the HP C compiler, which does stricter checking than many conventional