Compilation yields the following warning. When -Werror is enabled, this causes
the build to fail.
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I../secmem -Wall -g -O2
-Wall -Wno-pointer-sign -Wpointer-arith -c -o pinentry-curses.o pinentry-curses.c
pinentry-curses.c: In function ‘dialog_create’:
pinentry-curses.c:466:8: warning: implicit declaration of function ‘addnwstr’
[-Wimplicit-function-declaration]
ADDCH (start[i]); ^
Reason seems to be that the wrong curses.h header file is included when cursesw
is used.
Proposed solution:
Include the ncursesw/curses.h header file when using ncursesw.
- pinentry-0.9.7-unpatched/pinentry/pinentry-curses.c 2015-06-30
10:30:16.000000000 +0200
+++ pinentry-0.9.7-patched/pinentry/pinentry-curses.c 2016-04-16
09:07:09.027429582 +0200
@@ -22,7 +22,11 @@
#include <config.h>
#endif
#include <assert.h>
+#ifdef HAVE_NCURSESW
+#include <ncursesw/curses.h>
+#else
#include <curses.h>
+#endif /*HAVE_NCURSESW*/
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>