[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] [PATCH] Fix a warning from gcc: vwprintw is deprecated
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-dev] [PATCH] Fix a warning from gcc: vwprintw is deprecated |
Date: |
Tue, 29 Jan 2019 14:58:58 -0800 |
Yo Sanjeev!
Thanks! Patch applied to git head.
I have to admit to ignoring gpsmon. I always found it to be annoying. And
now it is suffering from the lack of attention. Things like the GNSS
constellation are not supported in gpsmon like they are in cgps and xgps.
On Tue, 29 Jan 2019 21:53:58 +0800
Sanjeev Gupta <address@hidden> wrote:
> The function vwprintw, declared in curses.h is called out by gcc
> because of its use of varargs.h . The actaul implementation uses
> stdarg.h , however GCC does not know this. Switch to the newer
> calling form to make gcc happy.
>
> gcc -o gpsmon.o -c -pthread -Wall -Wcast-align -Wextra
> -Wimplicit-fallthrough -Wmissing-declarations -Wmissing-prototypes
> -Wno-missing-field-initializers -Wno-uninitialized -Wpointer-arith
> -Wreturn-type -Wstrict-prototypes -Wvla -O2 -pthread
> -DHAVE_SYS_TIMEPPS_H=1 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600
> -I/usr/include/dbus-1.0 -I/usr/lib/i386-linux-gnu/dbus-1.0/include
> -I/usr/include/libusb-1.0 gpsmon.c gpsmon.c: In function
> 'monitor_vcomplain': gpsmon.c:392:5: warning: 'vwprintw' is
> deprecated [-Wdeprecated-declarations] (void)vwprintw(cmdwin, (char
> *)fmt, ap); ^ In file included from gpsmon.h:11, from
> gpsmon.c:31: /usr/include/curses.h:816:28: note: declared here extern
> NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list)
> GCC_DEPRECATED(use vw_printw); /* implemented */ ^~~~~~~~ gpsmon.c:
> In function 'monitor_log': gpsmon.c:419:2: warning: 'vwprintw' is
> deprecated [-Wdeprecated-declarations] (void)vwprintw(packetwin,
> (char *)fmt, ap); ^ In file included from gpsmon.h:11, from
> gpsmon.c:31: /usr/include/curses.h:816:28: note: declared here
> extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list)
> GCC_DEPRECATED(use vw_printw); /* implemented */ ^~~~~~~~
> ---
> gpsmon.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gpsmon.c b/gpsmon.c
> index eee5e4d8..7ecac1b9 100644
> --- a/gpsmon.c
> +++ b/gpsmon.c
> @@ -389,7 +389,7 @@ static void monitor_vcomplain(const char *fmt,
> va_list ap) (void)wmove(cmdwin, 0, (int)promptlen);
> (void)wclrtoeol(cmdwin);
> (void)wattrset(cmdwin, A_BOLD);
> - (void)vwprintw(cmdwin, (char *)fmt, ap);
> + (void)vw_printw(cmdwin, (char *)fmt, ap);
> (void)wattrset(cmdwin, A_NORMAL);
> (void)wrefresh(cmdwin);
> (void)doupdate();
> @@ -416,7 +416,7 @@ void monitor_log(const char *fmt, ...)
> va_list ap;
> report_lock();
> va_start(ap, fmt);
> - (void)vwprintw(packetwin, (char *)fmt, ap);
> + (void)vw_printw(packetwin, (char *)fmt, ap);
> va_end(ap);
> report_unlock();
> }
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
pgp7c4zgWAaBa.pgp
Description: OpenPGP digital signature