HP-UX Cadvise Diagnostics Reference Guide (5900-1865, August 2012)

Table Of Contents
Reference:
4230 64 bit migration: conversion from %t1 to %t2 may cause target of
pointers to have a different size.
Cause:
The compiler has detected conversion between pointers to data types having different sizes. This
usually happens when assigning an int pointer to a long pointer or vice versa. This is not a problem
in 32 bit mode since int, long and pointer all are of same size (32 bit) but in 64 bit mode int is
32 bit whereas long and pointer are 64 bit. Because of the difference in size in 64 bit mode this
conversion might lead to incorrect behavior in 64 bit mode.
Example:
long l = 1;
long *lptr = &l;
int *iptr = (int *)lptr;
Action:
For 64 bit portability ensure that your code does not convert from pointer to int to pointer to long
and vice versa.
Reference:
4231 64 bit migration: conversion between types of different sizes has
occurred (from %t1 to %t2 )
Cause:
The compiler has detected conversion between data types having different sizes. This usually
happens when converting from int data type to pointer or long data type and vice versa. This is
not a problem in 32 bit mode since int, long and pointer all are of same size (32 bit) but in 64
bit mode int is 32 bit whereas long and pointer are 64 bit. Because of the difference in size n 64
bit mode this conversion might lead to incorrect behavior in 64 bit mode.
Example:
void foo(int i) {
foo((void*)i);
return i;
}
Action:
For 64 bit portability ensure that your code does not convert from int to pointer or long and vice
versa.
Reference:
4232 conversion from %t1 to a more strictly aligned type %t2 may cause
misaligned access
Cause:
A pointer is being cast from a lesser aligned type to a more strictly aligned type. Accesses using
the new type may cause misaligned access.
Example:
int foo(int* p, long long* l) {
54 Diagnostics Details