about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY2
-rw-r--r--lib/pam.h7
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 23445add..f3c2aabf 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,6 +6,8 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.39.00
 
+              PAM_STRUCT_SIZE: cast pointer to ulong instead of uint.
+
               pamthreshold: fix totally bogus threshold selection with
               simple thresholding.
 
diff --git a/lib/pam.h b/lib/pam.h
index e66b831d..8f9f5d12 100644
--- a/lib/pam.h
+++ b/lib/pam.h
@@ -118,8 +118,13 @@ struct pam {
    member named x.  This is useful in conjunction with the 'len' value
    to determine which fields are present in the structure.
 */
+
+/* Some compilers are really vigilant and recognize it as an error
+   to cast a 64 bit address to a 32 bit type.  Hence the roundabout
+   casting in PAM_MEMBER_OFFSET.
+*/
 #define PAM_MEMBER_OFFSET(mbrname) \
-  ((unsigned int)(char*)&((struct pam *)0)->mbrname)
+  ((size_t)(unsigned long)(char*)&((struct pam *)0)->mbrname)
 #define PAM_MEMBER_SIZE(mbrname) \
   sizeof(((struct pam *)0)->mbrname)
 #define PAM_STRUCT_SIZE(mbrname) \