X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/35c0995dde0c37486681630acdd8d26659a4732e..aa02ed367404c659ab7205ef9662ef92032d7786:/key/key-data.h diff --git a/key/key-data.h b/key/key-data.h index 9c00908..cfeff82 100644 --- a/key/key-data.h +++ b/key/key-data.h @@ -160,10 +160,26 @@ typedef struct key_filter { unsigned m; } key_filter; -/* --- Matching aginst key selection --- */ +/* --- Matching aginst key selection --- * + * + * GCC will warn about constant addresses in this test, which is rather + * unfortunate. Muffle the warning. This is rather hideous because of the + * way GCC's parser handles pragmata. + */ + +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# define KEY_MATCH_MUFFLE_WARNING(x) __extension__ ({ \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Waddress\"") \ + (x); \ + _Pragma("GCC diagnostic pop") \ + }) +#else +# define KEY_MATCH_MUFFLE_WARNING(x) (x) +#endif #define KEY_MATCH(kd, kf) \ - (!(kf) || \ + (KEY_MATCH_MUFFLE_WARNING(!(kf)) || \ ((kd)->e & KF_ENCMASK) == KENC_STRUCT || \ ((kd)->e & (kf)->m) == (kf)->f)