From f162f792e04541a5158b791523b82a60a9d80913 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 17 Feb 2016 15:58:24 -0500 Subject: [PATCH] Harmonize struct packing for gic_opt.c struct extended_options in gic_opt.c extends krb5_get_init_creds_opt. On Mac OS X, for historical reasons, we define krb5_get_init_creds_opt with an alignment/packing of 2, conflicting with the compiler default. This results in alignment change warnings from clang on Mac OS X. Ensure that extended_options has the same packing. --- src/lib/krb5/krb/gic_opt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/krb5/krb/gic_opt.c b/src/lib/krb5/krb/gic_opt.c index 4d4e46bd5b..d4b8918aa9 100644 --- a/src/lib/krb5/krb/gic_opt.c +++ b/src/lib/krb5/krb/gic_opt.c @@ -8,6 +8,14 @@ #define DEFAULT_FLAGS KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT +#if defined(__MACH__) && defined(__APPLE__) +#include +#endif + +/* Match struct packing of krb5_get_init_creds_opt on MacOS X. */ +#if TARGET_OS_MAC +#pragma pack(push,2) +#endif struct extended_options { krb5_get_init_creds_opt opt; int num_preauth_data; @@ -21,6 +29,9 @@ struct extended_options { krb5_responder_fn responder; void *responder_data; }; +#if TARGET_OS_MAC +#pragma pack(pop) +#endif void KRB5_CALLCONV krb5_get_init_creds_opt_init(krb5_get_init_creds_opt *opt) -- 2.47.2