aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2021-03-01 14:58:34 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2021-03-01 15:01:44 +0000
commit95da5e131a0a9e48f0a063e3ff75000434cc5c52 (patch)
tree6671988405eaf6b991c93fb0e327500a55c20f67
parenta5f9fe2bab789f49e8b53da3a62dbd34725e23ea (diff)
downloadsrc-95da5e131a0a9e48f0a063e3ff75000434cc5c52.tar.gz
src-95da5e131a0a9e48f0a063e3ff75000434cc5c52.zip
dialog: fix macro redefinition
dialog.h defines MIN and MAX (making sure to undefine the previous macros if it already exists), but sys/param.h also defines those macros (without guards) and is included after dialog.h resulting in both gcc and clang complaining about macro redefiniton While clang do accept -Wno-macro-redefined to ignore the redefinition warning, gcc does not [1] Undefine both macros prior inclusion of sys/param.h to avoid the warning Reported by: arichardson
-rw-r--r--contrib/dialog/util.c2
-rw-r--r--gnu/lib/libdialog/Makefile2
2 files changed, 3 insertions, 1 deletions
diff --git a/contrib/dialog/util.c b/contrib/dialog/util.c
index 992be3f433f5..726a36a5031d 100644
--- a/contrib/dialog/util.c
+++ b/contrib/dialog/util.c
@@ -39,6 +39,8 @@
#endif
#ifdef HAVE_SYS_PARAM_H
+#undef MIN
+#undef MAX
#include <sys/param.h>
#endif
diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile
index 8c6b84b64f90..b97e4df9373a 100644
--- a/gnu/lib/libdialog/Makefile
+++ b/gnu/lib/libdialog/Makefile
@@ -15,7 +15,7 @@ MAN= dialog.3
LIBADD= ncursesw m
-CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -Wno-macro-redefined
+CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED
.PATH: ${DIALOG}
WARNS?= 1