[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-readline] MinGW compilation warnings in readline's input.c
From: |
Eli Zaretskii |
Subject: |
[Bug-readline] MinGW compilation warnings in readline's input.c |
Date: |
Mon, 08 May 2017 18:11:27 +0300 |
When compiling Readline (as part of GDB) with MinGW on MS-Windows, I
see the following warnings:
gcc -c -DHAVE_CONFIG_H -I. -I. -DRL_LIBRARY_VERSION='"6.2"' -O2
-gdwarf-4 -g3 -D__USE_MINGW_ACCESS input.c
input.c: In function 'rl_gather_tyi':
input.c:252:33: warning: implicit declaration of function '_kbhit'
[-Wimplicit-function-declaration]
chars_avail = isatty (tty) ? _kbhit () : 0;
^
input.c: In function 'rl_getc':
input.c:501:10: warning: implicit declaration of function '_getch'
[-Wimplicit-function-declaration]
return (_getch ());
^
The solution is to include the system header which declares the
respective prototypes:
diff --git a/input.c b/input.c
index 24126ea..e19fa85 100644
--- a/input.c
+++ b/input.c
@@ -98,6 +98,7 @@ static int rl_gather_tyi PARAMS((void));
/* Windows isatty returns true for every character device, including the null
device, so we need to perform additional checks. */
#if defined (_WIN32) && !defined (__CYGWIN__)
+#include <conio.h>
#include <io.h>
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
- [Bug-readline] MinGW compilation warnings in readline's input.c,
Eli Zaretskii <=