Print this page
3373 gcc >= 4.5 concerns about offsetof()

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/avs/ns/rdc/rdc_io.c
          +++ new/usr/src/uts/common/avs/ns/rdc/rdc_io.c
↓ open down ↓ 5635 lines elided ↑ open up ↑
5636 5636          wakeup_busy(krdc);
5637 5637          mutex_exit(&rdc_conf_lock);
5638 5638  
5639 5639          return (rc);
5640 5640  }
5641 5641  
5642 5642  /*
5643 5643   * Yet another standard thing that is not standard ...
5644 5644   */
5645 5645  #ifndef offsetof
5646      -#define offsetof(s, m)  ((size_t)(&((s *)0)->m))
     5646 +#if defined(__GNUC__)
     5647 +#define offsetof(s, m)  __builtin_offsetof(s, m)
     5648 +#else
     5649 +#define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
     5650 +#endif
5647 5651  #endif
5648 5652  
5649 5653  static int
5650 5654  rdc_status(void *arg, int mode, rdc_config_t *uparms, spcs_s_info_t kstatus)
5651 5655  {
5652 5656          rdc_k_info_t *krdc;
5653 5657          rdc_u_info_t *urdc;
5654 5658          disk_queue *dqp;
5655 5659          int rc = 0;
5656 5660          int index;
↓ open down ↓ 1068 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX