warn-cast-align.cpp [plain text]
void test0(char *P) {
char *a; short *b; int *c;
a = (char*) P;
a = static_cast<char*>(P);
a = reinterpret_cast<char*>(P);
typedef char *CharPtr;
a = CharPtr(P);
b = (short*) P; b = reinterpret_cast<short*>(P);
typedef short *ShortPtr;
b = ShortPtr(P);
c = (int*) P; c = reinterpret_cast<int*>(P);
typedef int *IntPtr;
c = IntPtr(P); }
void test1(void *P) {
char *a; short *b; int *c;
a = (char*) P;
a = static_cast<char*>(P);
a = reinterpret_cast<char*>(P);
typedef char *CharPtr;
a = CharPtr(P);
b = (short*) P;
b = static_cast<short*>(P);
b = reinterpret_cast<short*>(P);
typedef short *ShortPtr;
b = ShortPtr(P);
c = (int*) P;
c = static_cast<int*>(P);
c = reinterpret_cast<int*>(P);
typedef int *IntPtr;
c = IntPtr(P);
}