From 21e83f422667e431c1283b9ae3356fded3523e50 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Date: Wed, 13 May 2015 16:36:26 -0400 Subject: [PATCH] Avoid implicit declaration of function addnwstr. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * pinentry/pinentry-curses.c [HAVE_NCURSESW]: Include <ncursesw/curses.h>. [! HAVE_NCURSESW]: Only include <curses.h> in this case. -- When built with libncursesw, we see this problem: pinentry-curses.c:440:8: warning: implicit declaration of function ‘addnwstr’ [-Wimplicit-function-declaration] ADDCH (start[i]); ^ --- pinentry/pinentry-curses.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pinentry/pinentry-curses.c b/pinentry/pinentry-curses.c index 60fd9da..65a5a67 100644 --- a/pinentry/pinentry-curses.c +++ b/pinentry/pinentry-curses.c @@ -22,7 +22,11 @@ #include <config.h> #endif #include <assert.h> +#ifdef HAVE_NCURSESW +#include <ncursesw/curses.h> +#else #include <curses.h> +#endif #include <signal.h> #include <fcntl.h> #include <unistd.h> -- 2.11.0 diff -ruN pinentry-1.1.0-orig/pinentry/pinentry-curses.c pinentry-1.1.0/pinentry/pinentry-curses.c --- pinentry-1.1.0-orig/pinentry/pinentry-curses.c 2017-12-03 10:13:05.000000000 -0600 +++ pinentry-1.1.0/pinentry/pinentry-curses.c 2020-10-09 05:27:21.000000000 -0500 @@ -55,6 +55,9 @@ # define GPG_ERR_MISSING_ENVVAR 303 #endif +/* Get rid of implict warning */ +int addnwstr(); + /* FIXME: We should allow configuration of these button labels and in any case use the default_ok, default_cancel values if available.