Simulation of following code, compiled with V6.12 and optimzation
level -O2
#include <stdio.h>
typedef struct {
char data[23];
} device_t;
static device_t deviceList[100];
static device_t* rotate(device_t *device)
{
int index;
index = (device - &deviceList[0]) + 1;
if (index < 0 || index > 30) {
index = 0;
}
printf("index = %d\n", index);
return &
↧