summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-01-30 17:35:48 +0100
committerDmitry V. Levin <ldv@strace.io>2023-01-30 16:35:48 +0000
commite2ada10676aa6ce116964a41f083fa4776e9453a (patch)
tree5410d65d815b54ab73f4785b44df6cee0bbc9905
parent4618442c50a89208520a5259aa5a9472b99bb3c7 (diff)
downloadlinux-pam-git-e2ada10676aa6ce116964a41f083fa4776e9453a.tar.gz
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.
-rw-r--r--m4/warn_lang_flags.m41
-rw-r--r--modules/pam_unix/pam_unix_passwd.c8
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 <rpc/rpc.h>
-# if HAVE_RPCSVC_YP_PROT_H
+# ifdef HAVE_RPCSVC_YP_PROT_H
# include <rpcsvc/yp_prot.h>
# endif
-# if HAVE_RPCSVC_YPCLNT_H
+# ifdef HAVE_RPCSVC_YPCLNT_H
# include <rpcsvc/ypclnt.h>
# 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 */