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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fm/fmadm/common/faulty.c
          +++ new/usr/src/cmd/fm/fmadm/common/faulty.c
↓ open down ↓ 38 lines elided ↑ open up ↑
  39   39  #include <fm/fmd_msg.h>
  40   40  #include <dlfcn.h>
  41   41  #include <sys/systeminfo.h>
  42   42  #include <sys/utsname.h>
  43   43  #include <libintl.h>
  44   44  #include <locale.h>
  45   45  #include <sys/smbios.h>
  46   46  #include <libdevinfo.h>
  47   47  #include <stdlib.h>
  48   48  
       49 +#if defined(__GNUC__)
       50 +#define offsetof(s, m)  __builtin_offsetof(s, m)
       51 +#else
  49   52  #define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
       53 +#endif
  50   54  
  51   55  /*
  52   56   * Fault records are added to catalog by calling add_fault_record_to_catalog()
  53   57   * records are stored in order of importance to the system.
  54   58   * If -g flag is set or not_suppressed is not set and the class fru, fault,
  55   59   * type are the same then details are merged into an existing record, with uuid
  56   60   * records are stored in time order.
  57   61   * For each record information is extracted from nvlist and merged into linked
  58   62   * list each is checked for identical records for which percentage certainty are
  59   63   * added together.
↓ open down ↓ 1807 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX