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

Table Of Contents
Useful Porting Tools
Open System Services Porting Guide520573-006
3-3
CodeCheck Tool
findcalls performs a simple but fast lexical analysis of your C source code by
searching for occurrences of system calls. By using the UNIX comm utility to compare
the list of system calls used by the application with the list provided in the OSS
environment, you can approximate the task of porting the application to the OSS
environment. (A shell script for the UNIX comm tasks is provided with findcalls.)
findcalls seeks occurrences of a known list of functions by using a list you provide
when starting findcalls. The default list supplied by HP contains all the functions
whose names appear in reference pages for SunOS, OSF/1, and UNIX System V
Release 4 (SVR4). Each time findcalls finds a function call, it checks whether the
function name is present in the provided list of OSS function calls. If it finds the call,
findcalls writes the name to a file whose name ends in.is_in_list.” If it does
not find the call, findcalls writes the name to a file whose name ends in
.not_in_list.”
The findcalls distribution includes a helpful README file explaining the use of the
tool in detail. Within the README file, there is a tutorial that directs you through an
example of using findcalls.
CodeCheck Tool
CodeCheck is a programming tool developed by ABRAXAS Software, Inc. for the UNIX
workstation. It examines source C and C++ code for compliance with POSIX.1 and
POSIX.2 standards. It reviews code and locates which parts are not portable (not
standards-compliant). When it encounters a noncompliant line of code, CodeCheck
flags it and offers suggestions on how to correct it.
CodeCheck uses rule files to check for invalid or faulty coding techniques. For
example, there are rules that check for ISO/ANSI C compatibility, for portability
(specific vendor machines, or in general), and for maintainability. Further, there are rule
files that check for good programming techniques and format: consistent braces,
proper indentation, and ordering of file elements.
You make your checking selections from the optional parameters and the library of rule
profiles. CodeCheck’s options are available at the command line. You can do the
following:
Show progress of code checking
Identify the dialect of C to be assumed for the source files, such as Common C,
ISO/ANSI C, or C++
Define macros and list macro expansions
Count tokens, lines, operators, and operands
Create prototypes for all functions defined in a project
Enable embedded SQL statements
CodeCheck works with many variations of C and C++ source code, including source
code for HP, Microsoft, Borland, Microtec, Green Hills, MetaWare, Watcom, AT&T,