diff options
-rw-r--r-- | src/fundamental/macro-fundamental.h | 4 | ||||
-rw-r--r-- | src/nss-systemd/nss-systemd.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 6122a0a92b..7bee2915e1 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -56,6 +56,10 @@ _Pragma("GCC diagnostic push"); \ _Pragma("GCC diagnostic ignored \"-Wzero-length-bounds\"") +#define DISABLE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"") + #define REENABLE_WARNING \ _Pragma("GCC diagnostic pop") diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c index d686d920fc..683352fab9 100644 --- a/src/nss-systemd/nss-systemd.c +++ b/src/nss-systemd/nss-systemd.c @@ -101,6 +101,9 @@ typedef struct GetentData { bool by_membership; } GetentData; +/* On current glibc PTHREAD_MUTEX_INITIALIZER is defined in a way incompatible with + * -Wzero-as-null-pointer-constant, work around this for now. */ +DISABLE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT; static GetentData getpwent_data = { .mutex = PTHREAD_MUTEX_INITIALIZER, }; @@ -116,6 +119,7 @@ static GetentData getspent_data = { static GetentData getsgent_data = { .mutex = PTHREAD_MUTEX_INITIALIZER, }; +REENABLE_WARNING; static void setup_logging_once(void) { static pthread_once_t once = PTHREAD_ONCE_INIT; |