请考虑以下代码:
typedef struct {
int type;
} object_t;
typedef struct {
object_t object;
int age;
} person_t;
int age(object_t *object) {
if (object->type == PERSON) {
return ((person_t *)object)->age;
} else {
return 0;
}
}
这是法律代码还是违反了 C99 严格的别名规则?请解释为什么它是合法/非法的。