Print this page
3373 gcc >= 4.5 concerns about offsetof()
@@ -44,11 +44,15 @@
#include <locale.h>
#include <sys/smbios.h>
#include <libdevinfo.h>
#include <stdlib.h>
+#if defined(__GNUC__)
+#define offsetof(s, m) __builtin_offsetof(s, m)
+#else
#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
+#endif
/*
* Fault records are added to catalog by calling add_fault_record_to_catalog()
* records are stored in order of importance to the system.
* If -g flag is set or not_suppressed is not set and the class fru, fault,