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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/vscan/vscan_svc.c
          +++ new/usr/src/uts/common/io/vscan/vscan_svc.c
↓ open down ↓ 49 lines elided ↑ open up ↑
  50   50  #define VS_SCANWAIT_DEFAULT     15*60   /* seconds to wait for scan result */
  51   51  #define VS_REQL_HANDLER_TIMEOUT 30
  52   52  #define VS_EXT_RECURSE_DEPTH    8
  53   53  
  54   54  /* access derived from scan result (VS_STATUS_XXX) and file attributes */
  55   55  #define VS_ACCESS_UNDEFINED     0
  56   56  #define VS_ACCESS_ALLOW         1       /* return 0 */
  57   57  #define VS_ACCESS_DENY          2       /* return EACCES */
  58   58  
  59   59  #define tolower(C)      (((C) >= 'A' && (C) <= 'Z') ? (C) - 'A' + 'a' : (C))
  60      -#define offsetof(s, m)  (size_t)(&(((s *)0)->m))
       60 +#if defined(__GNUC__)
       61 +#define offsetof(s, m)  __builtin_offsetof(s, m)
       62 +#else
       63 +#define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
       64 +#endif
  61   65  
  62   66  /* global variables - tunable via /etc/system */
  63   67  uint32_t vs_reqs_max = VS_REQS_DEFAULT; /* max scan requests */
  64   68  uint32_t vs_nodes_max = VS_NODES_DEFAULT; /* max in-progress scan requests */
  65   69  uint32_t vs_workers = VS_WORKERS_DEFAULT; /* max workers send reqs to vscand */
  66   70  uint32_t vs_scan_wait = VS_SCANWAIT_DEFAULT; /* secs to wait for scan result */
  67   71  
  68   72  
  69   73  /*
  70   74   * vscan_svc_state
↓ open down ↓ 1297 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX