title: What is the purpose of this `data[0]` declaration in struct?
body: <p>In the C, syntax of <strong>flexible array member</strong> like this:</p>
  
  <pre><code>struct s 
  { 
      int n; 
      double d[];  // flexible array member
  };
  </code></pre>
  
  <p>And, <strong>Zero size array</strong> illegal in C.</p>
  
  <p>If I declare array like this:</p>
  
  <pre><code>struct s 
  { 
      double d[0];  // Zero size array
  };
  </code></pre>
  
  <p>GCC give warning:</p>
  
  <pre><code>warning: ISO C forbids zero-size array 'd' [-Wpedantic]
  </code></pre>
  
  <p>So, I'm going to my main question. </p>
  
  <p>I saw following code <a href="https://github.com/torvalds/linux/blob/master/fs/squashfs/squashfs_fs.h#L435" rel="nofollow noreferrer">here</a>.</p>
  
  <pre><code>struct squashfs_xattr_entry {
      __le16          type;
      __le16          size;
      char            data[0];
  };
  </code></pre>
  
  <p>In C zero-size array illegal.</p>
  
  <p>Then, </p>
  
  <ul>
  <li>What is the purpose of this <code>data[0]</code> declaration in struct?</li>
  <li>What does <code>data[0]</code> do here?</li>
  </ul>