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.c
          +++ new/usr/src/uts/common/avs/ns/rdc/rdc.c
↓ open down ↓ 518 lines elided ↑ open up ↑
 519  519          }
 520  520  
 521  521          return (0);
 522  522  }
 523  523  
 524  524  
 525  525  /*
 526  526   * Yet another standard thing that is not standard ...
 527  527   */
 528  528  #ifndef offsetof
 529      -#define offsetof(s, m)  ((size_t)(&((s *)0)->m))
      529 +#if defined(__GNUC__)
      530 +#define offsetof(s, m)  __builtin_offsetof(s, m)
      531 +#else
      532 +#define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
      533 +#endif
 530  534  #endif
 531  535  
 532  536  /*
 533  537   * Build a 32bit rdc_set structure and copyout to the user level.
 534  538   */
 535  539  int
 536  540  rdc_status_copy32(const void *arg, void *usetp, size_t size, int mode)
 537  541  {
 538  542          rdc_u_info_t *urdc = (rdc_u_info_t *)arg;
 539  543          struct rdc_set32 set32;
↓ open down ↓ 576 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX