Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses libcurses: fix usage of __warn_references



details:   https://anonhg.NetBSD.org/src/rev/f417f48e0c27
branches:  trunk
changeset: 985266:f417f48e0c27
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 15 15:12:36 2021 +0000

description:
libcurses: fix usage of __warn_references

Since that macro can expand to an empty token list, it adds its own
semicolon as needed.  Removing the extra semicolon fixes the lint
warnings about empty declarations.  These empty declarations are a GCC
extension.

diffstat:

 lib/libcurses/get_wstr.c  |  12 ++++++------
 lib/libcurses/getstr.c    |  12 ++++++------
 lib/libcurses/in_wchstr.c |  12 ++++++------
 lib/libcurses/inchstr.c   |  12 ++++++------
 lib/libcurses/instr.c     |  12 ++++++------
 lib/libcurses/inwstr.c    |  12 ++++++------
 6 files changed, 36 insertions(+), 36 deletions(-)

diffs (truncated from 324 to 300 lines):

diff -r 093a55ff7287 -r f417f48e0c27 lib/libcurses/get_wstr.c
--- a/lib/libcurses/get_wstr.c  Sun Aug 15 14:26:39 2021 +0000
+++ b/lib/libcurses/get_wstr.c  Sun Aug 15 15:12:36 2021 +0000
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif                                           /* not lint */
 
 #include "curses.h"
@@ -61,7 +61,7 @@
  *     Get a string from stdscr starting at (cury, curx).
  */
 __warn_references(get_wstr,
-       "warning: this program uses get_wstr(), which is unsafe.");
+       "warning: this program uses get_wstr(), which is unsafe.")
 int
 get_wstr(wchar_t *wstr)
 {
@@ -83,7 +83,7 @@
  *       Get a string from stdscr starting at (y, x).
  */
 __warn_references(mvget_wstr,
-       "warning: this program uses mvget_wstr(), which is unsafe.");
+       "warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvget_wstr(int y, int x, wchar_t *wstr)
 {
@@ -109,7 +109,7 @@
  *       Get a string from the given window starting at (y, x).
  */
 __warn_references(mvget_wstr,
-       "warning: this program uses mvget_wstr(), which is unsafe.");
+       "warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvwget_wstr(WINDOW *win, int y, int x, wchar_t *wstr)
 {
@@ -124,7 +124,7 @@
  *     Get a string starting at (cury, curx).
  */
 __warn_references(wget_wstr,
-       "warning: this program uses wget_wstr(), which is unsafe.");
+       "warning: this program uses wget_wstr(), which is unsafe.")
 int
 wget_wstr(WINDOW *win, wchar_t *wstr)
 {
diff -r 093a55ff7287 -r f417f48e0c27 lib/libcurses/getstr.c
--- a/lib/libcurses/getstr.c    Sun Aug 15 14:26:39 2021 +0000
+++ b/lib/libcurses/getstr.c    Sun Aug 15 15:12:36 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getstr.c,v 1.27 2019/06/09 07:40:14 blymn Exp $        */
+/*     $NetBSD: getstr.c,v 1.28 2021/08/15 15:12:36 rillig Exp $       */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)getstr.c   8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getstr.c,v 1.27 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: getstr.c,v 1.28 2021/08/15 15:12:36 rillig Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -61,7 +61,7 @@
  *     Get a string from stdscr starting at (cury, curx).
  */
 __warn_references(getstr,
-    "warning: this program uses getstr(), which is unsafe.");
+    "warning: this program uses getstr(), which is unsafe.")
 int
 getstr(char *str)
 {
@@ -83,7 +83,7 @@
  *      Get a string from stdscr starting at (y, x).
  */
 __warn_references(mvgetstr,
-    "warning: this program uses mvgetstr(), which is unsafe.");
+    "warning: this program uses mvgetstr(), which is unsafe.")
 int
 mvgetstr(int y, int x, char *str)
 {
@@ -109,7 +109,7 @@
  *      Get a string from the given window starting at (y, x).
  */
 __warn_references(mvgetstr,
-    "warning: this program uses mvgetstr(), which is unsafe.");
+    "warning: this program uses mvgetstr(), which is unsafe.")
 int
 mvwgetstr(WINDOW *win, int y, int x, char *str)
 {
@@ -126,7 +126,7 @@
  *     Get a string starting at (cury, curx).
  */
 __warn_references(wgetstr,
-    "warning: this program uses wgetstr(), which is unsafe.");
+    "warning: this program uses wgetstr(), which is unsafe.")
 int
 wgetstr(WINDOW *win, char *str)
 {
diff -r 093a55ff7287 -r f417f48e0c27 lib/libcurses/in_wchstr.c
--- a/lib/libcurses/in_wchstr.c Sun Aug 15 14:26:39 2021 +0000
+++ b/lib/libcurses/in_wchstr.c Sun Aug 15 15:12:36 2021 +0000
@@ -1,4 +1,4 @@
-/*   $NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif                                           /* not lint */
 
 #include "curses.h"
@@ -47,7 +47,7 @@
  *     Return an array of wide characters at cursor position from stdscr.
  */
 __warn_references(in_wchstr,
-       "warning: this program uses in_wchstr(), which is unsafe.");
+       "warning: this program uses in_wchstr(), which is unsafe.")
 int
 in_wchstr(cchar_t *wchstr)
 {
@@ -65,7 +65,7 @@
  *  Return an array of wide characters at position (y, x) from stdscr.
  */
 __warn_references(mvin_wchstr,
-       "warning: this program uses mvin_wchstr(), which is unsafe.");
+       "warning: this program uses mvin_wchstr(), which is unsafe.")
 int
 mvin_wchstr(int y, int x, cchar_t *wchstr)
 {
@@ -83,7 +83,7 @@
  *  Return an array wide characters at position (y, x) from the given window.
  */
 __warn_references(mvwin_wchstr,
-       "warning: this program uses mvwin_wchstr(), which is unsafe.");
+       "warning: this program uses mvwin_wchstr(), which is unsafe.")
 int
 mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr)
 {
@@ -107,7 +107,7 @@
  *     Return an array of characters at cursor position.
  */
 __warn_references(win_wchstr,
-       "warning: this program uses win_wchstr(), which is unsafe.");
+       "warning: this program uses win_wchstr(), which is unsafe.")
 int
 win_wchstr(WINDOW *win, cchar_t *wchstr)
 {
diff -r 093a55ff7287 -r f417f48e0c27 lib/libcurses/inchstr.c
--- a/lib/libcurses/inchstr.c   Sun Aug 15 14:26:39 2021 +0000
+++ b/lib/libcurses/inchstr.c   Sun Aug 15 15:12:36 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inchstr.c,v 1.10 2019/06/09 07:40:14 blymn Exp $       */
+/*     $NetBSD: inchstr.c,v 1.11 2021/08/15 15:12:36 rillig Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: inchstr.c,v 1.10 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: inchstr.c,v 1.11 2021/08/15 15:12:36 rillig Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -50,7 +50,7 @@
  *     Return an array of characters at cursor position from stdscr.
  */
 __warn_references(inchstr,
-    "warning: this program uses inchstr(), which is unsafe.");
+    "warning: this program uses inchstr(), which is unsafe.")
 int
 inchstr(chtype *chstr)
 {
@@ -70,7 +70,7 @@
  *      Return an array of characters at position (y, x) from stdscr.
  */
 __warn_references(mvinchstr,
-    "warning: this program uses mvinchstr(), which is unsafe.");
+    "warning: this program uses mvinchstr(), which is unsafe.")
 int
 mvinchstr(int y, int x, chtype *chstr)
 {
@@ -90,7 +90,7 @@
  *      Return an array characters at position (y, x) from the given window.
  */
 __warn_references(mvwinchstr,
-    "warning: this program uses mvwinchstr(), which is unsafe.");
+    "warning: this program uses mvwinchstr(), which is unsafe.")
 int
 mvwinchstr(WINDOW *win, int y, int x, chtype *chstr)
 {
@@ -118,7 +118,7 @@
  *     Return an array of characters at cursor position.
  */
 __warn_references(winchstr,
-    "warning: this program uses winchstr(), which is unsafe.");
+    "warning: this program uses winchstr(), which is unsafe.")
 int
 winchstr(WINDOW *win, chtype *chstr)
 {
diff -r 093a55ff7287 -r f417f48e0c27 lib/libcurses/instr.c
--- a/lib/libcurses/instr.c     Sun Aug 15 14:26:39 2021 +0000
+++ b/lib/libcurses/instr.c     Sun Aug 15 15:12:36 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: instr.c,v 1.7 2019/06/09 07:40:14 blymn Exp $  */
+/*     $NetBSD: instr.c,v 1.8 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: instr.c,v 1.7 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: instr.c,v 1.8 2021/08/15 15:12:36 rillig Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -50,7 +50,7 @@
  *     Return a string of characters at cursor position from stdscr.
  */
 __warn_references(instr,
-    "warning: this program uses instr(), which is unsafe.");
+    "warning: this program uses instr(), which is unsafe.")
 int
 instr(char *str)
 {
@@ -69,7 +69,7 @@
  *     XXX: should be multi-byte characters for SUSv2.
  */
 __warn_references(mvinstr,
-    "warning: this program uses mvinstr(), which is unsafe.");
+    "warning: this program uses mvinstr(), which is unsafe.")
 int
 mvinstr(int y, int x, char *str)
 {
@@ -88,7 +88,7 @@
  *     XXX: should be multi-byte characters for SUSv2.
  */
 __warn_references(mvwinstr,
-    "warning: this program uses mvwinstr(), which is unsafe.");
+    "warning: this program uses mvwinstr(), which is unsafe.")
 int
 mvwinstr(WINDOW *win, int y, int x, char *str)
 {
@@ -115,7 +115,7 @@
  *     XXX: should be multi-byte characters for SUSv2.
  */
 __warn_references(winstr,
-    "warning: this program uses winstr(), which is unsafe.");
+    "warning: this program uses winstr(), which is unsafe.")
 int
 winstr(WINDOW *win, char *str)
 {
diff -r 093a55ff7287 -r f417f48e0c27 lib/libcurses/inwstr.c
--- a/lib/libcurses/inwstr.c    Sun Aug 15 14:26:39 2021 +0000
+++ b/lib/libcurses/inwstr.c    Sun Aug 15 15:12:36 2021 +0000
@@ -1,4 +1,4 @@
-/*   $NetBSD: inwstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: inwstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: inwstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: inwstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif                                           /* not lint */
 
 #include "curses.h"
@@ -47,7 +47,7 @@
  *     Return a string of wide characters at cursor position from stdscr.
  */
 __warn_references(inwstr,
-       "warning: this program uses inwstr(), which is unsafe.");
+       "warning: this program uses inwstr(), which is unsafe.")
 int
 inwstr(wchar_t *wstr)
 {
@@ -65,7 +65,7 @@
  *  Return a string of wide characters at position (y, x) from stdscr.
  */



Home | Main Index | Thread Index | Old Index