arr[0] is kernel code ???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All ,
       Why is 0 length arrays

for instance

struct ext2_xattr_entry {
    __u8    e_name_len;    /* length of name */
    __u8    e_name_index;    /* attribute name index */
    __le16    e_value_offs;    /* offset in disk block of value */
    __le32    e_value_block;    /* disk block attribute is stored on (n/i) */
    __le32    e_value_size;    /* size of attribute value */
    __le32    e_hash;        /* hash value of name and value */
    char    e_name[0];    /* attribute name */ <<<-------------------------------------------- Why ??
};

AND

struct mb_cache_entry {
    struct list_head        e_lru_list;
    struct mb_cache            *e_cache;
    unsigned short            e_used;
    unsigned short            e_queued;
    struct block_device        *e_bdev;
    sector_t            e_block;
    struct list_head        e_block_list;
    struct {
        struct list_head    o_list;
        unsigned int        o_key;
    } e_indexes[0]; <<<-------------------------------------------- Why ??
};

 used in many structures in the kernel code ? What is their significance ?  and Why is

do {
 // exp 1
//exp 2
//exp 3
}while (0) ;

used ?

Regards,
Onkar




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux