xref: /aoo41x/main/tools/workben/solar.c (revision fe69567b)
1*fe69567bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*fe69567bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*fe69567bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*fe69567bSAndrew Rist  * distributed with this work for additional information
6*fe69567bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*fe69567bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*fe69567bSAndrew Rist  * "License"); you may not use this file except in compliance
9*fe69567bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*fe69567bSAndrew Rist  *
11*fe69567bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*fe69567bSAndrew Rist  *
13*fe69567bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*fe69567bSAndrew Rist  * software distributed under the License is distributed on an
15*fe69567bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*fe69567bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*fe69567bSAndrew Rist  * specific language governing permissions and limitations
18*fe69567bSAndrew Rist  * under the License.
19*fe69567bSAndrew Rist  *
20*fe69567bSAndrew Rist  *************************************************************/
21*fe69567bSAndrew Rist 
22*fe69567bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <stdio.h>
25cdf0e10cSrcweir #include <stdlib.h>
26cdf0e10cSrcweir 
27cdf0e10cSrcweir typedef enum { t_char, t_short, t_int, t_long, t_double } Type;
28cdf0e10cSrcweir typedef int (*TestFunc)( Type, void* );
29cdf0e10cSrcweir 
30cdf0e10cSrcweir struct Description;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir int IsBigEndian(void);
33cdf0e10cSrcweir int IsStackGrowingDown_2( int * pI );
34cdf0e10cSrcweir int IsStackGrowingDown(void);
35cdf0e10cSrcweir int GetStackAlignment_3( char*p, long l, int i, short s, char b, char c, ... );
36cdf0e10cSrcweir int GetStackAlignment_2( char*p, long l, int i, short s, char b, char c );
37cdf0e10cSrcweir int GetStackAlignment(void);
38cdf0e10cSrcweir void PrintArgs( int p, ... );
39cdf0e10cSrcweir int check( TestFunc func, Type eT, void* p );
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #if defined (UNX) || defined (WNT) || defined (OS2)
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #ifdef UNX
44cdf0e10cSrcweir #include <unistd.h>
45cdf0e10cSrcweir #endif
46cdf0e10cSrcweir #include <sys/types.h>
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #define I_STDARG
49cdf0e10cSrcweir #ifdef I_STDARG
50cdf0e10cSrcweir #include <stdarg.h>
51cdf0e10cSrcweir #else
52cdf0e10cSrcweir #include <varargs.h>
53cdf0e10cSrcweir #endif
54cdf0e10cSrcweir 
55cdf0e10cSrcweir #define NO_USE_FORK_TO_CHECK
56cdf0e10cSrcweir #ifdef USE_FORK_TO_CHECK
57cdf0e10cSrcweir #include <sys/wait.h>
58cdf0e10cSrcweir #else
59cdf0e10cSrcweir #include <signal.h>
60cdf0e10cSrcweir #include <setjmp.h>
61cdf0e10cSrcweir #endif
62cdf0e10cSrcweir 
63cdf0e10cSrcweir #else
64cdf0e10cSrcweir #endif
65cdf0e10cSrcweir 
66cdf0e10cSrcweir #define printTypeSize(Type,Name)	printf(	"sizeof(%s)\t= %d\n", Name,	\
67cdf0e10cSrcweir 				sizeof (Type) )
68cdf0e10cSrcweir 
69cdf0e10cSrcweir #define isSignedType(Type)	(((Type)-1) < 0)
70cdf0e10cSrcweir #define printTypeSign(Type,Name)	printf(	"%s\t= %s %s\n", Name,		\
71cdf0e10cSrcweir 				( isSignedType(Type) ? "unsigned" : "signed" ), Name )
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 
IsBigEndian()74cdf0e10cSrcweir int IsBigEndian()
75cdf0e10cSrcweir {
76cdf0e10cSrcweir   long l = 1;
77cdf0e10cSrcweir   return ! *(char*)&l;
78cdf0e10cSrcweir }
79cdf0e10cSrcweir 
IsStackGrowingDown_2(int * pI)80cdf0e10cSrcweir int IsStackGrowingDown_2( int * pI )
81cdf0e10cSrcweir {
82cdf0e10cSrcweir   int i = 1;
83cdf0e10cSrcweir   return ((unsigned long)&i) < (unsigned long)pI;
84cdf0e10cSrcweir }
85cdf0e10cSrcweir 
IsStackGrowingDown()86cdf0e10cSrcweir int IsStackGrowingDown()
87cdf0e10cSrcweir {
88cdf0e10cSrcweir   int i = 1;
89cdf0e10cSrcweir   return IsStackGrowingDown_2(&i);
90cdf0e10cSrcweir }
91cdf0e10cSrcweir 
GetStackAlignment_3(char * p,long l,int i,short s,char b,char c,...)92cdf0e10cSrcweir int GetStackAlignment_3( char*p, long l, int i, short s, char b, char c, ... )
93cdf0e10cSrcweir {
94cdf0e10cSrcweir   (void) p; (void) l; (void) i; (void) s; /* unused */
95cdf0e10cSrcweir   if ( IsStackGrowingDown() )
96cdf0e10cSrcweir 	return &c - &b;
97cdf0e10cSrcweir   else
98cdf0e10cSrcweir 	return &b - &c;
99cdf0e10cSrcweir }
100cdf0e10cSrcweir 
GetStackAlignment_2(char * p,long l,int i,short s,char b,char c)101cdf0e10cSrcweir int GetStackAlignment_2( char*p, long l, int i, short s, char b, char c )
102cdf0e10cSrcweir {
103cdf0e10cSrcweir   (void) p; (void) l; (void) i; (void) s; /* unused */
104cdf0e10cSrcweir   if ( IsStackGrowingDown() )
105cdf0e10cSrcweir 	return &c - &b;
106cdf0e10cSrcweir   else
107cdf0e10cSrcweir 	return &b - &c;
108cdf0e10cSrcweir }
109cdf0e10cSrcweir 
GetStackAlignment()110cdf0e10cSrcweir int GetStackAlignment()
111cdf0e10cSrcweir {
112cdf0e10cSrcweir   int nStackAlignment = GetStackAlignment_3(0,1,2,3,4,5);
113cdf0e10cSrcweir   if ( nStackAlignment != GetStackAlignment_2(0,1,2,3,4,5) )
114cdf0e10cSrcweir 	printf( "Pascal calling convention\n" );
115cdf0e10cSrcweir   return nStackAlignment;
116cdf0e10cSrcweir }
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 
121cdf0e10cSrcweir #if defined (UNX) || defined (WNT) || defined (OS2)
122cdf0e10cSrcweir 
123cdf0e10cSrcweir #ifdef I_STDARG
PrintArgs(int p,...)124cdf0e10cSrcweir void PrintArgs( int p, ... )
125cdf0e10cSrcweir #else
126cdf0e10cSrcweir void PrintArgs( p, va_alist )
127cdf0e10cSrcweir int p;
128cdf0e10cSrcweir va_dcl
129cdf0e10cSrcweir #endif
130cdf0e10cSrcweir {
131cdf0e10cSrcweir 	int value;
132cdf0e10cSrcweir 	va_list ap;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir #ifdef I_STDARG
135cdf0e10cSrcweir     va_start( ap, p );
136cdf0e10cSrcweir #else
137cdf0e10cSrcweir     va_start( ap );
138cdf0e10cSrcweir #endif
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	printf( "value = %d", p );
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 	while ( ( value = va_arg(ap, int) ) != 0 )
143cdf0e10cSrcweir 	  printf( " %d", value );
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 	printf( "\n" );
146cdf0e10cSrcweir 	va_end(ap);
147cdf0e10cSrcweir }
148cdf0e10cSrcweir 
149cdf0e10cSrcweir #ifndef USE_FORK_TO_CHECK
150cdf0e10cSrcweir static jmp_buf check_env;
151cdf0e10cSrcweir static int bSignal;
152cdf0e10cSrcweir #if defined (UNX) || defined (OS2)
SignalHandler(int sig)153cdf0e10cSrcweir void SignalHandler( int sig )
154cdf0e10cSrcweir #else
155cdf0e10cSrcweir void __cdecl SignalHandler( int sig )
156cdf0e10cSrcweir #endif
157cdf0e10cSrcweir {
158cdf0e10cSrcweir   bSignal = 1;
159cdf0e10cSrcweir   /*
160cdf0e10cSrcweir   fprintf( stderr, "Signal %d caught\n", sig );
161cdf0e10cSrcweir   signal( sig,	SignalHandler );
162cdf0e10cSrcweir   */
163cdf0e10cSrcweir   longjmp( check_env, sig );
164cdf0e10cSrcweir }
165cdf0e10cSrcweir #endif
166cdf0e10cSrcweir 
check(TestFunc func,Type eT,void * p)167cdf0e10cSrcweir int check( TestFunc func, Type eT, void* p )
168cdf0e10cSrcweir {
169cdf0e10cSrcweir #ifdef USE_FORK_TO_CHECK
170cdf0e10cSrcweir   pid_t nChild = fork();
171cdf0e10cSrcweir   if ( nChild )
172cdf0e10cSrcweir   {
173cdf0e10cSrcweir     int exitVal;
174cdf0e10cSrcweir     wait( &exitVal );
175cdf0e10cSrcweir     if ( exitVal & 0xff )
176cdf0e10cSrcweir       return -1;
177cdf0e10cSrcweir     else
178cdf0e10cSrcweir       return exitVal >> 8;
179cdf0e10cSrcweir   }
180cdf0e10cSrcweir   else
181cdf0e10cSrcweir   {
182cdf0e10cSrcweir     exit( func( eT, p ) );
183cdf0e10cSrcweir   }
184cdf0e10cSrcweir #else
185cdf0e10cSrcweir   int result;
186cdf0e10cSrcweir 
187cdf0e10cSrcweir   bSignal = 0;
188cdf0e10cSrcweir 
189cdf0e10cSrcweir   if ( !setjmp( check_env ) )
190cdf0e10cSrcweir   {
191cdf0e10cSrcweir 	signal( SIGSEGV,	SignalHandler );
192cdf0e10cSrcweir #ifdef UNX
193cdf0e10cSrcweir 	signal( SIGBUS,	SignalHandler );
194cdf0e10cSrcweir #else
195cdf0e10cSrcweir #endif
196cdf0e10cSrcweir 	result = func( eT, p );
197cdf0e10cSrcweir 	signal( SIGSEGV,	SIG_DFL );
198cdf0e10cSrcweir #ifdef UNX
199cdf0e10cSrcweir 	signal( SIGBUS,	SIG_DFL );
200cdf0e10cSrcweir #else
201cdf0e10cSrcweir #endif
202cdf0e10cSrcweir   }
203cdf0e10cSrcweir 
204cdf0e10cSrcweir   if ( bSignal )
205cdf0e10cSrcweir 	return -1;
206cdf0e10cSrcweir   else
207cdf0e10cSrcweir 	return 0;
208cdf0e10cSrcweir #endif
209cdf0e10cSrcweir }
210cdf0e10cSrcweir 
211cdf0e10cSrcweir #endif
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 
GetAtAddress(Type eT,void * p)214cdf0e10cSrcweir int GetAtAddress( Type eT, void* p )
215cdf0e10cSrcweir {
216cdf0e10cSrcweir   switch ( eT )
217cdf0e10cSrcweir   {
218cdf0e10cSrcweir   case t_char:		return *((char*)p);
219cdf0e10cSrcweir   case t_short:		return *((short*)p);
220cdf0e10cSrcweir   case t_int:		return *((int*)p);
221cdf0e10cSrcweir   case t_long:		return *((long*)p);
222cdf0e10cSrcweir   case t_double:	return *((double*)p);
223cdf0e10cSrcweir   }
224cdf0e10cSrcweir   abort();
225cdf0e10cSrcweir }
226cdf0e10cSrcweir 
SetAtAddress(Type eT,void * p)227cdf0e10cSrcweir int SetAtAddress( Type eT, void* p )
228cdf0e10cSrcweir {
229cdf0e10cSrcweir   switch ( eT )
230cdf0e10cSrcweir   {
231cdf0e10cSrcweir   case t_char:		return *((char*)p)	= 0;
232cdf0e10cSrcweir   case t_short:		return *((short*)p)	= 0;
233cdf0e10cSrcweir   case t_int:		return *((int*)p)	= 0;
234cdf0e10cSrcweir   case t_long:		return *((long*)p)	= 0;
235cdf0e10cSrcweir   case t_double:	return *((double*)p)= 0;
236cdf0e10cSrcweir   }
237cdf0e10cSrcweir   abort();
238cdf0e10cSrcweir }
239cdf0e10cSrcweir 
TypeName(Type eT)240cdf0e10cSrcweir char* TypeName( Type eT )
241cdf0e10cSrcweir {
242cdf0e10cSrcweir   switch ( eT )
243cdf0e10cSrcweir   {
244cdf0e10cSrcweir   case t_char:		return "char";
245cdf0e10cSrcweir   case t_short:		return "short";
246cdf0e10cSrcweir   case t_int:		return "int";
247cdf0e10cSrcweir   case t_long:		return "long";
248cdf0e10cSrcweir   case t_double:	return "double";
249cdf0e10cSrcweir   }
250cdf0e10cSrcweir   abort();
251cdf0e10cSrcweir }
252cdf0e10cSrcweir 
CheckGetAccess(Type eT,void * p)253cdf0e10cSrcweir int CheckGetAccess( Type eT, void* p )
254cdf0e10cSrcweir {
255cdf0e10cSrcweir   int b;
256cdf0e10cSrcweir   b = -1 != check( (TestFunc)GetAtAddress, eT, p );
257cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
258cdf0e10cSrcweir   fprintf( stderr,
259cdf0e10cSrcweir 		   "%s read %s at %p\n",
260cdf0e10cSrcweir 		   (b? "can" : "can not" ), TypeName(eT), p );
261cdf0e10cSrcweir #endif
262cdf0e10cSrcweir   return b;
263cdf0e10cSrcweir }
CheckSetAccess(Type eT,void * p)264cdf0e10cSrcweir int CheckSetAccess( Type eT, void* p )
265cdf0e10cSrcweir {
266cdf0e10cSrcweir   int b;
267cdf0e10cSrcweir   b = -1 != check( (TestFunc)SetAtAddress, eT, p );
268cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
269cdf0e10cSrcweir   fprintf( stderr,
270cdf0e10cSrcweir 		   "%s write %s at %p\n",
271cdf0e10cSrcweir 		   (b? "can" : "can not" ), TypeName(eT), p );
272cdf0e10cSrcweir #endif
273cdf0e10cSrcweir   return b;
274cdf0e10cSrcweir }
275cdf0e10cSrcweir 
GetAlignment(Type eT)276cdf0e10cSrcweir int GetAlignment( Type eT )
277cdf0e10cSrcweir {
278cdf0e10cSrcweir   char	a[ 16*8 ];
279cdf0e10cSrcweir   int	p = (int)(void*)&a;
280cdf0e10cSrcweir   int	i;
281cdf0e10cSrcweir   p = ( p + 0xF ) & ~0xF;
282cdf0e10cSrcweir   for ( i = 1; i < 16; i++ )
283cdf0e10cSrcweir 	if ( CheckGetAccess( eT, (void*)(p+i) ) )
284cdf0e10cSrcweir 	  return i;
285cdf0e10cSrcweir   return 0;
286cdf0e10cSrcweir }
287cdf0e10cSrcweir 
CheckCharAccess(char * p)288cdf0e10cSrcweir int CheckCharAccess( char* p )
289cdf0e10cSrcweir {
290cdf0e10cSrcweir   if ( CheckGetAccess( t_char, p ) )
291cdf0e10cSrcweir     printf( "can read address %p\n", p );
292cdf0e10cSrcweir   else
293cdf0e10cSrcweir     printf( "can not read address %p\n", p );
294cdf0e10cSrcweir 
295cdf0e10cSrcweir   if ( CheckSetAccess( t_char, p ) )
296cdf0e10cSrcweir     printf( "can write address %p\n", p );
297cdf0e10cSrcweir   else
298cdf0e10cSrcweir     printf( "can not write address %p\n", p );
299cdf0e10cSrcweir 
300cdf0e10cSrcweir   return 0;
301cdf0e10cSrcweir }
302cdf0e10cSrcweir 
303cdf0e10cSrcweir struct Description
304cdf0e10cSrcweir {
305cdf0e10cSrcweir   int	bBigEndian;
306cdf0e10cSrcweir   int	bStackGrowsDown;
307cdf0e10cSrcweir   int	nStackAlignment;
308cdf0e10cSrcweir   int	nAlignment[3];	/* 2,4,8 */
309cdf0e10cSrcweir };
310cdf0e10cSrcweir 
Description_Ctor(struct Description * pThis)311cdf0e10cSrcweir void Description_Ctor( struct Description* pThis )
312cdf0e10cSrcweir {
313cdf0e10cSrcweir   pThis->bBigEndian			= IsBigEndian();
314cdf0e10cSrcweir   pThis->bStackGrowsDown	= IsStackGrowingDown();
315cdf0e10cSrcweir   pThis->nStackAlignment	= GetStackAlignment();
316cdf0e10cSrcweir 
317cdf0e10cSrcweir   if ( sizeof(short) != 2 )
318cdf0e10cSrcweir 	abort();
319cdf0e10cSrcweir   pThis->nAlignment[0] = GetAlignment( t_short );
320cdf0e10cSrcweir   if ( sizeof(int) != 4 )
321cdf0e10cSrcweir 	abort();
322cdf0e10cSrcweir   pThis->nAlignment[1] = GetAlignment( t_int );
323cdf0e10cSrcweir   if ( sizeof(double) != 8 )
324cdf0e10cSrcweir 	abort();
325cdf0e10cSrcweir   pThis->nAlignment[2] = GetAlignment( t_double );
326cdf0e10cSrcweir }
327cdf0e10cSrcweir 
Description_Print(struct Description * pThis,char * name)328cdf0e10cSrcweir void Description_Print( struct Description* pThis, char* name )
329cdf0e10cSrcweir {
330cdf0e10cSrcweir   int i;
331cdf0e10cSrcweir   FILE* f = fopen( name, "w" );
332cdf0e10cSrcweir   fprintf( f, "#define __%s\n",
333cdf0e10cSrcweir 		   pThis->bBigEndian ? "BIGENDIAN" : "LITTLEENDIAN" );
334cdf0e10cSrcweir   for ( i = 0; i < 3; i++ )
335cdf0e10cSrcweir 	fprintf( f, "#define __ALIGNMENT%d\t%d\n",
336cdf0e10cSrcweir 			 1 << (i+1), pThis->nAlignment[i] );
337cdf0e10cSrcweir   fprintf( f, "#define __STACKALIGNMENT wird nicht benutzt\t%d\n", pThis->nStackAlignment );
338cdf0e10cSrcweir   fprintf( f, "#define __STACKDIRECTION\t%d\n",
339cdf0e10cSrcweir 		   pThis->bStackGrowsDown ? -1 : 1 );
340cdf0e10cSrcweir   fprintf( f, "#define __SIZEOFCHAR\t%d\n", sizeof( char ) );
341cdf0e10cSrcweir   fprintf( f, "#define __SIZEOFSHORT\t%d\n", sizeof( short ) );
342cdf0e10cSrcweir   fprintf( f, "#define __SIZEOFINT\t%d\n", sizeof( int ) );
343cdf0e10cSrcweir   fprintf( f, "#define __SIZEOFLONG\t%d\n", sizeof( long ) );
344cdf0e10cSrcweir   fprintf( f, "#define __SIZEOFPOINTER\t%d\n", sizeof( void* ) );
345cdf0e10cSrcweir   fprintf( f, "#define __SIZEOFDOUBLE\t%d\n", sizeof( double ) );
346cdf0e10cSrcweir   fprintf( f, "#define __IEEEDOUBLE\n" );
347cdf0e10cSrcweir   fprintf( f, "#define _SOLAR_NODESCRIPTION\n" );
348cdf0e10cSrcweir 
349cdf0e10cSrcweir   fclose(f);
350cdf0e10cSrcweir }
351cdf0e10cSrcweir 
352cdf0e10cSrcweir int
353cdf0e10cSrcweir #ifdef WNT
354cdf0e10cSrcweir __cdecl
355cdf0e10cSrcweir #endif
main(int argc,char * argv[])356cdf0e10cSrcweir main( int argc, char* argv[] )
357cdf0e10cSrcweir {
358cdf0e10cSrcweir   printTypeSign( char, "char" );
359cdf0e10cSrcweir   printTypeSign( short, "short" );
360cdf0e10cSrcweir   printTypeSign( int, "int" );
361cdf0e10cSrcweir   printTypeSign( long, "long" );
362cdf0e10cSrcweir 
363cdf0e10cSrcweir   printTypeSize( char, "char" );
364cdf0e10cSrcweir   printTypeSize( short, "short" );
365cdf0e10cSrcweir   printTypeSize( int, "int" );
366cdf0e10cSrcweir   printTypeSize( long, "long" );
367cdf0e10cSrcweir   printTypeSize( float, "float" );
368cdf0e10cSrcweir   printTypeSize( double, "double" );
369cdf0e10cSrcweir   printTypeSize( void *, "void *" );
370cdf0e10cSrcweir 
371cdf0e10cSrcweir   if ( IsBigEndian() )
372cdf0e10cSrcweir     printf( "BIGENDIAN (Sparc, MC680x0, RS6000)\n" );
373cdf0e10cSrcweir   else
374cdf0e10cSrcweir     printf( "LITTLEENDIAN (Intel, VAX, PowerPC)\n" );
375cdf0e10cSrcweir 
376cdf0e10cSrcweir   if( IsStackGrowingDown() )
377cdf0e10cSrcweir     printf( "Stack waechst nach unten\n" );
378cdf0e10cSrcweir   else
379cdf0e10cSrcweir     printf( "Stack waechst nach oben\n" );
380cdf0e10cSrcweir 
381cdf0e10cSrcweir   printf( "STACKALIGNMENT   : %d\n", GetStackAlignment() );
382cdf0e10cSrcweir 
383cdf0e10cSrcweir   PrintArgs( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 );
384cdf0e10cSrcweir 
385cdf0e10cSrcweir   {
386cdf0e10cSrcweir 	char  a[64];
387cdf0e10cSrcweir 	int   i = 56;
388cdf0e10cSrcweir 	do
389cdf0e10cSrcweir 	{
390cdf0e10cSrcweir 	  printf( "Zugriff long auf %i-Aligned Adresse : ", i / 7 );
391cdf0e10cSrcweir 	  printf( ( CheckGetAccess( t_long, (long*)&a[i] ) ? "OK\n" : "ERROR\n" ) );
392cdf0e10cSrcweir 	  i >>= 1;
393cdf0e10cSrcweir 	} while( i >= 7 );
394cdf0e10cSrcweir   }
395cdf0e10cSrcweir 
396cdf0e10cSrcweir   {
397cdf0e10cSrcweir 	char  a[64];
398cdf0e10cSrcweir 	int   i = 56;
399cdf0e10cSrcweir 	do
400cdf0e10cSrcweir 	{
401cdf0e10cSrcweir 	  printf( "Zugriff double auf %i-Aligned Adresse : ", i / 7 );
402cdf0e10cSrcweir 	  printf( ( CheckGetAccess( t_double, (double*)&a[i] ) ? "OK\n" : "ERROR\n" ) );
403cdf0e10cSrcweir 	  i >>= 1;
404cdf0e10cSrcweir 	} while( i >= 7 );
405cdf0e10cSrcweir   }
406cdf0e10cSrcweir 
407cdf0e10cSrcweir   {
408cdf0e10cSrcweir 	char* p = NULL;
409cdf0e10cSrcweir 	CheckCharAccess( p );
410cdf0e10cSrcweir 	p = (char*)&p;
411cdf0e10cSrcweir 	CheckCharAccess( p );
412cdf0e10cSrcweir   }
413cdf0e10cSrcweir 
414cdf0e10cSrcweir   if ( argc > 1 )
415cdf0e10cSrcweir   {
416cdf0e10cSrcweir 	struct Description description;
417cdf0e10cSrcweir 	Description_Ctor( &description );
418cdf0e10cSrcweir 	Description_Print( &description, argv[1] );
419cdf0e10cSrcweir   }
420cdf0e10cSrcweir 
421cdf0e10cSrcweir   exit( 0 );
422cdf0e10cSrcweir   return 0;
423cdf0e10cSrcweir }
424