Installation guide

Do not freely exchange pointers and integers. Assigning a pointer to an
int, assigning back to a pointer, and dereferencing the pointer may
result in a segmentation fault. For example, avoid assignments similar
to the following:
int i ;
char *buffer;
buffer = (char *)malloc(MAX_LINE)
i = (int)buffer;
buffer = (char*)i;
Use the lint Q command to find these pointer-to-int assignments.
If special steps are taken, pointer-to-int assignments can be retained
without causing addressing problems. See Section 7.3.1 for information
on how this is done.
Do not pass a pointer to a function expecting an int as this will result
in lost information. For example, avoid assignments similar to the
following:
void f();
char *cp;
f(cp);
This nonportable function declaration will produce a compiler warning
if you use ANSI C prototypes such as the following:
void f(int);
char *cp;
f(cp);
Use the lint -Q command to find these pointer-to-int assignments.
Use void *type if you need to use a generic pointer type. This is
preferable to converting a pointer to a type long.
Beware of the use of aliasing (different multiple definitions of the same
object). For example, the following two structures refer to the same
object in different ways:
struct node {
int src_addr,dst_addr;
char *name;
};
struct node {
struct node *src, *dst;
char *name;
}
Migrating Your ULTRIX Application to a DIGITAL UNIX System 7–17