From e2ada10676aa6ce116964a41f083fa4776e9453a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 30 Jan 2023 17:35:48 +0100 Subject: Enable undef warning * modules/pam_unix/pam_unix_passwd.c: Wrap checks for configure macros into defined() operator. * m4/warn_lang_flags.m4 (gl_WARN_ADD): Add -Wundef. --- m4/warn_lang_flags.m4 | 1 + modules/pam_unix/pam_unix_passwd.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/m4/warn_lang_flags.m4 b/m4/warn_lang_flags.m4 index 9447b9ee..3ae03274 100644 --- a/m4/warn_lang_flags.m4 +++ b/m4/warn_lang_flags.m4 @@ -20,6 +20,7 @@ gl_WARN_ADD([-Wpointer-arith]) gl_WARN_ADD([-Wreturn-type]) gl_WARN_ADD([-Wshadow]) gl_WARN_ADD([-Wstrict-prototypes]) +gl_WARN_ADD([-Wundef]) gl_WARN_ADD([-Wuninitialized]) gl_WARN_ADD([-Wunused]) gl_WARN_ADD([-Wwrite-strings]) diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c index a20e919e..ca721475 100644 --- a/modules/pam_unix/pam_unix_passwd.c +++ b/modules/pam_unix/pam_unix_passwd.c @@ -72,24 +72,24 @@ #include "passverify.h" #include "bigcrypt.h" -#if (HAVE_YP_GET_DEFAULT_DOMAIN || HAVE_GETDOMAINNAME) && HAVE_YP_MASTER +#if (defined(HAVE_YP_GET_DEFAULT_DOMAIN) || defined(HAVE_GETDOMAINNAME)) && defined(HAVE_YP_MASTER) # define HAVE_NIS #endif #ifdef HAVE_NIS # include -# if HAVE_RPCSVC_YP_PROT_H +# ifdef HAVE_RPCSVC_YP_PROT_H # include # endif -# if HAVE_RPCSVC_YPCLNT_H +# ifdef HAVE_RPCSVC_YPCLNT_H # include # endif # include "yppasswd.h" -# if !HAVE_DECL_GETRPCPORT &&!HAVE_RPCB_GETADDR +# if !defined(HAVE_DECL_GETRPCPORT) &&!defined(HAVE_RPCB_GETADDR) extern int getrpcport(const char *host, unsigned long prognum, unsigned long versnum, unsigned int proto); # endif /* GNU libc 2.1 */ -- cgit v1.2.1