OSPC - A Standards Enforcement Toolset for C
The Open Systems Portability Checker is designed to help solve
the following problems in your C code:
Portability - OSPC identifies code that will not port
between DOS, Windows NT, Unix, Microsoft Windows and the Power PC,
and porting to 64-bit machines.
Compliance - OSPC allows your corporate coding and
project specification standards to be completely automated for
validating compliance.
Maintainability - OSPC identifies and measures complex,
sloppy, and hard to maintain code.
Complexity - OSPC can generate a variety of program metrics, i.e.,
measure program size (Halstead), program cost, and program complexity (McCabe).
Checking is broken down into Language and API (Application Program Interface)
checks:
Language checks include:
-
Flag all constructs that don't strictly conform to the C standard (ISO/IEC 9899:1990,
including Amendment 1 and Technical Corrigendum 1).
-
Flag C/C++ incompatibilities.
-
Flag compiler dialect differences (K&R, SVR4, GCC).
-
Lint problems.
-
Flag potential 64/32 bit problems.
-
Support for Embedded SQL (ISO/IEC 9075:1992)
-
Flag expressions and functions that are too complex.
API checking is so sophisticated it needs it own
page to describe all the functionality
provided.
To see how OSPC has evolved over the last four years, check out back
issues of OSPC Update.
For a complete list of OSPC options check out its
man pages.
More technical information on OSPC
Tailoring OSPC
The information used to drive OSPC is user configurable.
This enables users to:
-
Change the text of generated messages.
-
Create platform profiles that describe the configuration
on which the software is to be ported.
-
Set OSPC's sensitivity to various constructs.
-
Switch off `uninteresting' warnings.
Availability
The latest version of OSPC is available now on Sun 4, RS/6000, HP PA-RISC
and Linux. Previous versions have been ported to Sequent, Digital
Alpha running OSF/1 and NT, Stratus, Stride and Motorola 88k. It can
quickly be ported to a wide range of Unix platforms.
-
Assigned but not accessed variables, also only assigned once
-
Constant expressions in a boolean context, as in: if (x = 1)
-
Constant expressions that reduce to zero such as XFLAG & YFLAG
-
Excessive shift values
-
External definitions that can be made static
-
ISO standard "quiet" changes
-
Indentation checking
-
Interunit type inconsistencies including function parameter
type mismatches and value return inconsistencies
-
Loss of sign in expressions
-
Mixing signed and unsigned quantities
-
Name clashes within x significant characters
-
Nested comments
-
Nested identifier definitions hiding outer definitions
-
Order of evaluation dependencies as in: a[i] = i++;
-
Overflow while processing arithmetic constants as in: 0xF << 28
-
Pointer irregularities such as returning pointers to auto objects
-
Pre-processor anomalies
-
printf/scanf format checking
-
Strong type checking based on typedef types
-
Suspicious truncations as in: double = float * float
-
Suspicious use of semi-colons as in: for (i=0; i<10; i++);
-
Uninitialized local variables
-
Unreachable code
-
Unreferenced headers
-
Unused compile time objects, including macro's, typedef's,
declarations, union's, enum's
-
Unused variables and functions
-
Unsigned relational comparisons against 0
-
Unusual expressions as in: flags & 4 == 0 (precedence error)
-
Wide variety of loss of precision loss errors as in:
int to char
Knowledge Software Ltd
Tel: +44 1252-520667
OSPC@knosof.co.uk
Home
Last updated
© Copyright 1997-2004. Knowledge Software Ltd. All rights reserved;