patch 7.4.2062
Problem:    Using dummy variable to compute struct member offset.
Solution:   Use offsetof().
diff --git a/src/globals.h b/src/globals.h
index 07e3cf7..f331202 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1649,18 +1649,6 @@
 #ifdef FEAT_EVAL
 EXTERN time_T time_for_testing INIT(= 0);
 
-/*
- * In a hashtab item "hi_key" points to "di_key" in a dictitem.
- * This avoids adding a pointer to the hashtab item.
- * DI2HIKEY() converts a dictitem pointer to a hashitem key pointer.
- * HIKEY2DI() converts a hashitem key pointer to a dictitem pointer.
- * HI2DI() converts a hashitem pointer to a dictitem pointer.
- */
-EXTERN dictitem_T dumdi;
-# define DI2HIKEY(di) ((di)->di_key)
-# define HIKEY2DI(p)  ((dictitem_T *)(p - (dumdi.di_key - (char_u *)&dumdi)))
-# define HI2DI(hi)     HIKEY2DI((hi)->hi_key)
-
 /* Abort conversion to string after a recursion error. */
 EXTERN int  did_echo_string_emsg INIT(= FALSE);
 #endif
diff --git a/src/macros.h b/src/macros.h
index ca54cb4..ae784d6 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -353,3 +353,14 @@
 #  endif
 # endif
 #endif
+
+/*
+ * In a hashtab item "hi_key" points to "di_key" in a dictitem.
+ * This avoids adding a pointer to the hashtab item.
+ * DI2HIKEY() converts a dictitem pointer to a hashitem key pointer.
+ * HIKEY2DI() converts a hashitem key pointer to a dictitem pointer.
+ * HI2DI() converts a hashitem pointer to a dictitem pointer.
+ */
+# define DI2HIKEY(di) ((di)->di_key)
+# define HIKEY2DI(p)  ((dictitem_T *)(p - offsetof(dictitem_T, di_key)))
+# define HI2DI(hi)     HIKEY2DI((hi)->hi_key)
diff --git a/src/spell.c b/src/spell.c
index af96891..f6ab0df 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -600,8 +600,7 @@
     char_u	wc_word[1];	    /* word, actually longer */
 } wordcount_T;
 
-static wordcount_T dumwc;
-#define WC_KEY_OFF  (unsigned)(dumwc.wc_word - (char_u *)&dumwc)
+#define WC_KEY_OFF  offsetof(wordcount_T, wc_word)
 #define HI2WC(hi)     ((wordcount_T *)((hi)->hi_key - WC_KEY_OFF))
 #define MAXWORDCOUNT 0xffff
 
diff --git a/src/version.c b/src/version.c
index 5be01ae..665c93e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2062,
+/**/
     2061,
 /**/
     2060,
diff --git a/src/vim.h b/src/vim.h
index 5067c5a..49fb870 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -505,6 +505,9 @@
 #endif
 #include <stdarg.h>
 
+/* for offsetof() */
+#include <stddef.h>
+
 #if defined(HAVE_SYS_SELECT_H) && \
 	(!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))
 # include <sys/select.h>