title: error: field has incomplete type
body: <p>I am attempting to port a library to Mac OS X. The compiler is reporting an incomplete type error. Specifically: field has incomplete type 'header_t []. However, when I look at the source code, header_t is defined just before packet_state_t, where packet_state_t references header_t. Thus, there shouldn't be any forward reference error, since header_t is clearly defined at the point at which it is referenced inside packet_state_t. The line in which the error occurs is marked with ERROR below. How to resolve?</p>
  
  <pre><code> typedef struct header_t {
      uint8_t  hdr_id;         // header ID
  
      uint8_t  hdr_prefix;     // length of the prefix (preamble) before the header
      uint8_t  hdr_gap;        // length of the gap between header and payload
      uint16_t  hdr_flags;      // flags for this header
      uint16_t hdr_postfix;    // length of the postfix (trailer) after the payload
      uint32_t hdr_offset;     // offset into the packet_t-&gt;data buffer
      uint32_t hdr_length;     // length of the header in packet_t-&gt;data buffer
      uint32_t hdr_payload;    // length of the payload
  
      uint8_t   hdr_subcount;  // number of sub-headers
      header_t  *hdr_subheader;   // Index of the first subheader in packet_t
  
      jobject  hdr_analysis;   // Java JAnalysis based object if not null
  } header_t;
  
  typedef struct packet_state_t {
      flow_key_t pkt_flow_key; // Flow key calculated for this packet, must be first
      uint8_t pkt_flags;       // flags for this packet
      jobject pkt_analysis;    // Java JAnalysis based object if not null
      uint64_t pkt_frame_num;  // Packet's frame number assigned by scanner
      uint64_t pkt_header_map; // bit map of presence of headers
  
      uint32_t pkt_wirelen;    // Original packet size
      uint32_t pkt_buflen;     // Captured length
  
      int8_t pkt_header_count; // total number of main headers found
      header_t pkt_headers[];  // One per header + 1 more for payload ERROR HERE!!!
  
      int8_t pkt_subheader_count;  // total number of sub headers found
      header_t pkt_subheaders[];  // One per header + 1 more for payload
  } packet_state_t;
  </code></pre>