2000-05-03 03:14:14 +00:00
|
|
|
/* This program will most likely crash on systems that need shorts and ints
|
|
|
|
to be word aligned
|
2005-07-15 22:51:23 +00:00
|
|
|
Copyright (C) 2005 Free Software Foundation
|
|
|
|
|
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
are permitted in any medium without royalty provided the copyright
|
|
|
|
notice and this notice are preserved.
|
|
|
|
|
2000-05-03 03:14:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
int main ()
|
|
|
|
{
|
2013-10-04 08:13:19 +00:00
|
|
|
char buf[32];
|
2013-10-01 18:00:17 +00:00
|
|
|
char *ptr = buf;
|
|
|
|
short sval = 4;
|
|
|
|
int ival = 3;
|
|
|
|
if (0 == ((int)ptr % 2))
|
|
|
|
{
|
|
|
|
ptr++;
|
|
|
|
}
|
|
|
|
*(short *)ptr = sval;
|
2013-10-04 08:13:19 +00:00
|
|
|
*(int *)(ptr + sizeof(short)) = ival;
|
|
|
|
ptr[sizeof(short) + sizeof(int)] = 0;
|
2013-10-01 18:00:17 +00:00
|
|
|
puts (ptr); /* force compiler not to optimise out the above assignments */
|
|
|
|
exit (0);
|
2000-05-03 03:14:14 +00:00
|
|
|
}
|
2013-10-01 18:00:17 +00:00
|
|
|
|