diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-19 18:40:16 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-19 18:40:16 +0000 |
commit | 466e1de674b42b2afe13d2edd998acbf656a9c76 (patch) | |
tree | 1afc324c413069314650031e9167f082e199aa2a /libpam/include | |
parent | f6c60926adc9fa08feaeb696ffa5bfbac7c8c9e8 (diff) | |
download | pam-466e1de674b42b2afe13d2edd998acbf656a9c76.tar.gz pam-466e1de674b42b2afe13d2edd998acbf656a9c76.tar.bz2 pam-466e1de674b42b2afe13d2edd998acbf656a9c76.zip |
Fix remaining clang -Wcast-align compilation warnings
Introduce DIAG_PUSH_IGNORE_CAST_ALIGN and DIAG_POP_IGNORE_CAST_ALIGN
macros, use them to silence remaining clang -Wcast-align compilation
warnings.
* libpam/include/pam_cc_compat.h (DIAG_PUSH_IGNORE_CAST_ALIGN,
DIAG_POP_IGNORE_CAST_ALIGN): New macros.
* modules/pam_access/pam_access.c: Include "pam_cc_compat.h".
(from_match, network_netmask_match): Wrap inet_ntop invocations
in DIAG_PUSH_IGNORE_CAST_ALIGN and DIAG_POP_IGNORE_CAST_ALIGN.
Diffstat (limited to 'libpam/include')
-rw-r--r-- | libpam/include/pam_cc_compat.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpam/include/pam_cc_compat.h b/libpam/include/pam_cc_compat.h index d4c905df..c43989f7 100644 --- a/libpam/include/pam_cc_compat.h +++ b/libpam/include/pam_cc_compat.h @@ -27,15 +27,27 @@ _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") # define DIAG_POP_IGNORE_CAST_QUAL \ _Pragma("GCC diagnostic pop") +# define DIAG_PUSH_IGNORE_CAST_ALIGN \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wcast-align\"") +# define DIAG_POP_IGNORE_CAST_ALIGN \ + _Pragma("GCC diagnostic pop") #elif PAM_CLANG_PREREQ(2, 6) # define DIAG_PUSH_IGNORE_CAST_QUAL \ _Pragma("clang diagnostic push"); \ _Pragma("clang diagnostic ignored \"-Wcast-qual\"") # define DIAG_POP_IGNORE_CAST_QUAL \ _Pragma("clang diagnostic pop") +# define DIAG_PUSH_IGNORE_CAST_ALIGN \ + _Pragma("clang diagnostic push"); \ + _Pragma("clang diagnostic ignored \"-Wcast-align\"") +# define DIAG_POP_IGNORE_CAST_ALIGN \ + _Pragma("clang diagnostic pop") #else # define DIAG_PUSH_IGNORE_CAST_QUAL /* empty */ # define DIAG_POP_IGNORE_CAST_QUAL /* empty */ +# define DIAG_PUSH_IGNORE_CAST_ALIGN /* empty */ +# define DIAG_POP_IGNORE_CAST_ALIGN /* empty */ #endif #endif /* PAM_CC_COMPAT_H */ |