What is the purpose of a zero length array in a struct?

Viewed 44953

When I'm looking the Linux kernel code, found the below code:

   struct thread_info {
    struct task_struct  *task;
    struct exec_domain  *exec_domain;
    unsigned long       flags;
    __u32           status;
    __u32           cpu;
    int         preempt_count;
    mm_segment_t        addr_limit;
    struct restart_block    restart_block;
    void __user     *sysenter_return;
    unsigned long           previous_esp;
    __u8            supervisor_stack[0];
};

Notice that the last variable "supervisor_stack", it is a zero length array, what is the usage of it? Thanks in advance!

2 Answers
Related