title: Why the forward declaration?
body: <p>I have the following bit of code provided by a vendor for a Bluetooth Low Energy (BLE) device.  From the code below, one can see that the struct <code>ble_lbs_t</code> is forward declared.  I am trying to understand why this is necessary in this case.  Is this an artifact of previous versions of C?  Could this have something to with the platform?  I am using the latest version of the GNU ARM embedded toolchain which uses the ARM embedded GCC compiler.  The documentation for the compiler states that it supports all GCC 5 features.</p>
  
  <pre><code>typedef struct ble_lbs_s ble_lbs_t;
  
  typedef void (*ble_lbs_led_write_handler_t) (ble_lbs_t * p_lbs, uint8_t new_state);
  typedef struct
  {
      ble_lbs_led_write_handler_t led_write_handler; 
  } ble_lbs_init_t;
  
  struct ble_lbs_s
  {
      uint16_t                    service_handle; 
      ble_gatts_char_handles_t    led_char_handles;    
      ble_gatts_char_handles_t    button_char_handles; 
      uint8_t                     uuid_type;           
      uint16_t                    conn_handle;         
      ble_lbs_led_write_handler_t led_write_handler;   
  };
  </code></pre>